Pytest выдает ошибки при параметризацииPython

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Pytest выдает ошибки при параметризации

Сообщение Anonymous »

РЕДАКТИРОВАТЬ: Это работает только в том случае, если я назвал переменную «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
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Удаление комбинации из составной параметризации в pytest
    Anonymous » » в форуме Python
    0 Ответы
    17 Просмотры
    Последнее сообщение Anonymous
  • Не использовать все аргументы из параметризации отметки pytest
    Anonymous » » в форуме Python
    0 Ответы
    6 Просмотры
    Последнее сообщение Anonymous
  • Удаление комбинации из составной параметризации в pytest
    Anonymous » » в форуме Python
    0 Ответы
    15 Просмотры
    Последнее сообщение Anonymous
  • Как смешать приспособления pytest, которые используют запросы и обычные значения для параметризации?
    Anonymous » » в форуме Python
    0 Ответы
    9 Просмотры
    Последнее сообщение Anonymous
  • @pytest.mark.skip против @pytest.mark.xfail в Pytest
    Anonymous » » в форуме Python
    0 Ответы
    38 Просмотры
    Последнее сообщение Anonymous

Вернуться в «Python»