首页 > 解决方案 > Pycharm Pytest 并行测试错误'E 夹具'驱动程序'未找到'任何人都可以帮助解决这个问题吗?

问题描述

def test_login(驱动程序):找不到 E 夹具“驱动程序”

  available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatc

h、pytestconfig、record_property、record_testsuite_property、record_xml_attribute、recwarn、testrun_uid、tmp_path、tmp_path_factory、tmpdir、tmpdir_factory、worker_id

  use 'pytest --fixtures [testpath]' for help on them.

我有驱动程序的 pytest 夹具设置,但我不知道如何解决这个问题?

标签: pythonpycharmpytestdriverfixtures

解决方案


尽管我确实对此感到有些愚蠢,但它可能对其他人有所帮助,所以我所做的是将“conftest.py”文件命名为“comftest.py”,并使用不正确的“m”或正确的“n” !现在我的“pytest -n 2”命令正在 Pycharm 的终端上运行。


推荐阅读