РЕДАКТИРОВАТЬ: Это работает только в том случае, если я назвал переменную «config», и никакие другие имена не работают.
import hashlib
import logging
from typing import Callable
import pytest
from pytest_embedded_idf.dut import IdfDut
EXPECT_TIMEOUT = 10
testdata = [2, 3, 4]
@pytest.mark.esp32s3
@pytest.mark.parametrize("x", testdata)
def test_hello_world(dut: IdfDut, x):
pass
Это выдает следующие ошибки
Это ошибка
Пожалуйста, помогите с решением этой проблемы. Я запускаю его на устройстве esp32s3 с USB-соединением UART.
Мой друг не получил никаких ошибок при выполнении приведенного выше кода, но я получил указанную выше ошибку.
Ошибка ->< /p>
============================================================================================================ ERRORS ============================================================================================================
____________________________________________________________________________________________ ERROR at setup of test_hello_world[2] _____________________________________________________________________________________________
C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\pytest_embedded\plugin.py:481: in wrapper
res = func(*args, **kwargs)
C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\pytest_embedded\plugin.py:674: in _listener
return _listener_gn(**locals())
C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\pytest_embedded\dut_factory.py:92: in _listener_gn
os.makedirs(os.path.dirname(_pexpect_logfile), exist_ok=True)
E NotADirectoryError: [WinError 267] The directory name is invalid: "C:\\Users\\Inito\\esp\\v5.2.1\\esp-idf\\pytest_embedded_log\\2024-05-25_15-46-55\\esp32s3.default.test_hello_world.{'x': 2}"
------------------------------------------------------------------------------------------------------ Captured log setup ------------------------------------------------------------------------------------------------------
WARNING root:conftest.py:133 checking binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build_esp32s3_default... missing... try another place
WARNING root:conftest.py:133 checking binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build_esp32s3... missing... try another place
WARNING root:conftest.py:133 checking binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build_default... missing... try another place
INFO root:conftest.py:130 found valid binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build
____________________________________________________________________________________________ ERROR at setup of test_hello_world[3] _____________________________________________________________________________________________
C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\pytest_embedded\plugin.py:481: in wrapper
res = func(*args, **kwargs)
C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\pytest_embedded\plugin.py:674: in _listener
return _listener_gn(**locals())
C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\pytest_embedded\dut_factory.py:92: in _listener_gn
os.makedirs(os.path.dirname(_pexpect_logfile), exist_ok=True)
E NotADirectoryError: [WinError 267] The directory name is invalid: "C:\\Users\\Inito\\esp\\v5.2.1\\esp-idf\\pytest_embedded_log\\2024-05-25_15-46-55\\esp32s3.default.test_hello_world.{'x': 3}"
------------------------------------------------------------------------------------------------------ Captured log setup ------------------------------------------------------------------------------------------------------
WARNING root:conftest.py:133 checking binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build_esp32s3_default... missing... try another place
WARNING root:conftest.py:133 checking binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build_esp32s3... missing... try another place
WARNING root:conftest.py:133 checking binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build_default... missing... try another place
INFO root:conftest.py:130 found valid binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build
____________________________________________________________________________________________ ERROR at setup of test_hello_world[4] _____________________________________________________________________________________________
C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\pytest_embedded\plugin.py:481: in wrapper
res = func(*args, **kwargs)
C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\pytest_embedded\plugin.py:674: in _listener
return _listener_gn(**locals())
C:\Espressif\python_env\idf5.2_py3.11_env\Lib\site-packages\pytest_embedded\dut_factory.py:92: in _listener_gn
os.makedirs(os.path.dirname(_pexpect_logfile), exist_ok=True)
E NotADirectoryError: [WinError 267] The directory name is invalid: "C:\\Users\\Inito\\esp\\v5.2.1\\esp-idf\\pytest_embedded_log\\2024-05-25_15-46-55\\esp32s3.default.test_hello_world.{'x': 4}"
------------------------------------------------------------------------------------------------------ Captured log setup ------------------------------------------------------------------------------------------------------
WARNING root:conftest.py:133 checking binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build_esp32s3_default... missing... try another place
WARNING root:conftest.py:133 checking binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build_esp32s3... missing... try another place
WARNING root:conftest.py:133 checking binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build_default... missing... try another place
INFO root:conftest.py:130 found valid binary path: C:\Users\Inito\esp\v5.2.1\esp-idf\hello_world\build
========================================================================================================= Failed Cases =========================================================================================================
========================================================================== you can use --ignore-result-files or --ignore-result-cases to ignore them ===========================================================================
esp32s3.default.test_hello_world.{'x': 2}
esp32s3.default.test_hello_world.{'x': 3}
esp32s3.default.test_hello_world.{'x': 4}
=================================================================================================== short test summary info ====================================================================================================
ERROR pytest_hello_world.py::test_hello_world[2] - NotADirectoryError: [WinError 267] The directory name is invalid: "C:\\Users\\Inito\\esp\\v5.2.1\\esp-idf\\pytest_embedded_log\\2024-05-25_15-46-55\\esp32s3.default.test_hello_world.{'x': 2}"
ERROR pytest_hello_world.py::test_hello_world[3] - NotADirectoryError: [WinError 267] The directory name is invalid: "C:\\Users\\Inito\\esp\\v5.2.1\\esp-idf\\pytest_embedded_log\\2024-05-25_15-46-55\\esp32s3.default.test_hello_world.{'x': 3}"
ERROR pytest_hello_world.py::test_hello_world[4] - NotADirectoryError: [WinError 267] The directory name is invalid: "C:\\Users\\Inito\\esp\\v5.2.1\\esp-idf\\pytest_embedded_log\\2024-05-25_15-46-55\\esp32s3.default.test_hello_world.{'x': 4}"
====================================================================================================== 3 errors in 0.36s =======================================================================================================
Подробнее здесь: https://stackoverflow.com/questions/785 ... arametrize
Pytest выдает ошибки при параметризации ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение