相关疑难解决方法(0)

我怎样才能让pytest忽略不将unittest子类化的Test *类?

我正在尝试通过pytest通过的testfixture 进行测试,但它一直在尝试收集不是测试的内容:

======================================================= pytest-warning summary ========================================================
WC1 /Users/chris/vcs/git/testfixtures/testfixtures/tests/test_comparison.py cannot collect test class 'TestClassA' because it has a __init__ constructor
WC1 /Users/chris/vcs/git/testfixtures/testfixtures/tests/test_components.py cannot collect test class 'TestComponents' because it has a __init__ constructor
WC1 /Users/chris/vcs/git/testfixtures/testfixtures/tests/test_datetime.py cannot collect test class 'TestTZInfo' because it has a __new__ constructor
WC1 /Users/chris/vcs/git/testfixtures/testfixtures/tests/test_datetime.py cannot collect test class 'TestTZ2Info' because it has a __new__ constructor
cannot collect test class 'TestContainer' because it has a __init__ constructor
cannot collect test class 'TestTZInfo' because it has a …
Run Code Online (Sandbox Code Playgroud)

python pytest

4
推荐指数
2
解决办法
2229
查看次数

标签 统计

pytest ×1

python ×1