我正在尝试使用trace.py
跑步时pytest
。我知道pytest
有自己的覆盖率插件pytest-cov
但限制(每行执行的次数不可用)不允许我现在使用它。同样对于coverage.py
我正在尝试这个命令:python3.4 -m trace -c -m -C . pytest test_script.py
test_script.py
:
class TestScript():
def test_print(self):
print ('Hello')
输出是:
nikhilh$ python3.4 -m trace -c -m -C . pytest test_script.py
pytest: Cannot run file 'pytest' because: [Errno 2] No such file or directory: 'pytest'
trace.py
显然,它的参数中需要一个文件,而不是另一个模块。我怎样才能修改这个命令来获取trace.py
与...一起工作pytest
?
编辑:
我找到了一种方法来完成这件事
nikhilh$ python3.4 -m trace -c -m -C . <pytest_script_absolute_path> test_script.py
看到大卫的评论,所以这是我当时使用的答案:
python3.4 -m trace -c -m -C . <pytest_script_absolute_path> test_script.py
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)