我从这里安装pytest的插件:http://pypi.python.org/pypi/pytest-cov。然后,我有一个简单的测试代码:pytest和覆盖组合不起作用
pytest.py:
class TestNumbers:
def test_int_float(self):
assert 1 == 1.0
def test_int_str(self):
assert 1 == 1
我试着用命令来测试它: 'py.test --cov,报告期内,公司--cov pytest.py'。但它不起作用。即使我给出pytest.py的绝对路径,它仍然没有收集数据。但是,如果我使用py.test pytest.py,它肯定会测试好的。
我很困惑这个问题,感谢您的帮助。
使用前缀为“test_”的文件名,但无论如何不要使用“pytest.py”,它会影响实际的“pytest”模块。 – hpk42