想象一下你糟糕的测试
pytest-poo的Python项目详细描述
pytest poo是pytest的插件,它指出 用一堆粪便做的糟糕的测试。
真的吗?为什么?
我在2013年欧洲杯上展示了大便选项。很多人认为我 应该放了它,就在这里。
要求
需要Pytest的最新版本(>;=2.3.4)。
快速启动
- pip install pytest-poo
- 使用pytest.mark.poo标记标记测试。
- 使用–poo选项运行测试以启用一堆poo输出。
文档
评分测试
将pytest.mark.poo标记添加到您认为糟糕的测试中。这个 标记是标准的py.test标记,可以在测试中这样使用 功能:
import pytest @pytest.mark.poo def test_something(): assert 0
或上课:
import pytest class MyTests(object): pytestmark = [pytest.mark.poo]
…或整个模块:
import pytest pytestmark = pytest.mark.poo def test_a(): assert 0 def test_b(): assert 0
在测试运行期间显示糟糕的测试
只需使用--poo选项运行py.test即可启用输出。永远 启用,将--poo添加到pytest.ini中的addopts:
[pytest] addopts = --poo