一、问题

在pycharm中运行带有pytest包的代码会出现如下错误:

E       fixture 'a' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

二、解决办法

1、问题原因

代码中包含了带有test的函数,pycharm自动运行使用的是pytest。
在这里插入图片描述

2、方法

改用python
在这里插入图片描述

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐