如果先前的测试失败,则跳过其余测试。
pytest-atomic的Python项目详细描述
欢迎使用pytest atomic
如果先前的测试失败,则跳过其余测试。
要求
- pytest=3.10.0
- python=3.6
与Python2.x不兼容
如何安装
$ pip install pytest-atomic --upgrade
用法
# pytest.ini[pytest][atomic]enable : trueelectronic : true
选项
Notice! [pytest]section must be included.
Notice! All options bellow must be under [atomic] section in pytest.ini.
- 启用:[true/false]默认值为false
- 电子版:[true/false]默认值为true
示例
importpytest@pytest.mark.atomicdeftest_fn1():assert0deftest_fn2():assert0classTestCls:@pytest.mark.atomicdeftest_1(self):assert0@pytest.mark.electronicdeftest_2(self):assert1deftest_3(self):assert0@pytest.mark.electronicdeftest_4(self):assert1deftest_5(self):assert0deftest_fn3():assert0@pytest.mark.atomicdeftest_fn4():assert0deftest_fn5():assert0
test_demo |____ test_fn1: Failed |____ test_fn2: Skipped |____ TestCls | |____ test_1 Failed | |____ test_2 Passed | |____ test_3 Skipped | |____ test_4 Passed | |____ test_5 Skipped | |____ test_fn3: Skipped |____ test_fn4: Failed |____ test_fn5: Skipped
贡献
我们非常欢迎您的贡献。测试可以用tox运行,请确保 在提交请求之前,覆盖范围至少保持不变。
许可证
“pytest-atomic”是根据MIT许可证的条款发布的免费开源软件
已知问题
- 直接标记测试类似乎不起作用,但可以标记该类中测试方法的第一个