pytest
测试路径
testpaths = .
Python路径
pythonpath = .
测试收集的文件模式
python_files = a/test_*.py
日志级别
log_level = INFO
日志格式
log_format = %(asctime)s - %(name)s - %(levelname)s - %(message)s
日志日期格式
log_date_format = %Y-%m-%d %H:%M:%S
过滤 PytestConfigWarning 警告
filterwarnings =
ignore::pytest.PytestConfigWarning
禁用错误堆栈信息
或者简洁输出,只显示测试结果 pytest common/TestReg.py -q --tb=no
详细输出但简化错误信息 pytest common/TestReg.py -v --tb=short
addopts = --tb=no