从git上拉下来的项目,运行的时候 具体报错信息如下:

________________________ ERROR at setup of test_label _________________________
file C:\tojoy\policy_copy\test\test_label.py, line 13
  def test_label(apply_condition):
E       fixture 'apply_condition' 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.
 

 出现这个问题的原因是因为函数名称中带有test 单词,把函数名字改掉之后就可以正常运行。

这是为什么? 从网上找了好久 说是与python 自带的test函数冲突,谁有更好的解释麻烦告诉我一下,感谢!

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐