?
参考文献:
pytest 配置文件 【pytest】pytest配置文件pytest.ini详解_Bug 挖掘机的博客-CSDN博客 pytest.ini配置 pytest–配置 - 邹邹很busy。 - 博客园 Pytest常用命令 pytest的warning处理机制
配置项:
[pytest]
console_output_style = classic
console_output_style = progress
console_output_style = count
[pytest]
testpaths = test_001
norecursedirs = .* venv test_001 *.egg dist build
[pytest]
python_classes = *Test Test* *Suite
python_files = test_* *_test check_*
?python_functions = test_* check_*
- 禁用用例:设置xfail_strict = true将会使那些被标记为@pytest.mark.xfail但实际通过的测试用例也被报告为失败
xfail_strict = true
[pytest]
xfail_strict = true
xpass_strict = true
- addopts:更改默认命令行选项,经常要用到某些参数,又不想重复输入
[pytest]
console_output_style = progress
python_files = test*.py
addopts = -vv
; -m configMarker
--disable-warnings
; --capture=sys
--alluredir allure_results
--maxfail=2 -rf
|