pytest不运行任何测试,原因不明。我尝试使用--debug,但没有得到任何有价值的信息。对于如何调试pytest的这种问题完全不清楚。(看起来像是pytest配置/环境变量/测试名称模式的问题?)
测试文件示例:
但是pytest为什么不运行任何测试呢?
测试文件示例:
import pytest
@pytest.mark.sanity
def test_me():
"""I'm a test."""
assert True
但是pytest为什么不运行任何测试呢?
$ pytest
================================================== test session starts ===================================================
platform linux2 -- Python 2.7.12, pytest-3.1.3, py-1.4.34, pluggy-0.4.0
rootdir: /home/qawizard/pytest-hell, inifile:
plugins: xdist-1.15.0, timeout-1.2.0
collected 1 item s
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Exit: Done! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================== no tests ran in 0.13 seconds ==============================================
pytest.ini
中注册了那个标记吗? 你在pytest.ini
中有其他的配置吗? 你可以重新运行pytest -lsvvv
命令来查看额外的详细输出吗? 你是否有一个带有一些自定义配置的conftest.py
文件? - Dmitry Tokarev