我有以下pytest
的配置文件:
[pytest]
filterwarnings =
ignore::DeprecationWarning
ignore::UserWarning
python_files =
test_file_1.py
test_file_2.py
log_cli = True
log_level = INFO
我使用以下命令在本地运行pytest
:
python -m pytest path
并获得输出
====================================================================================================== no tests ran in 24.77s =======================================================================================================
我不敢相信,因为之前,我在终端中得到了以下输出(由于日志(log)记录):
INFO root:test_file_1.py:40 torch.Size([100, 71])
我注意到,如果我删除pytest.ini
中的filterwarnings
,我得到的是warnings summary
,但不是输出"no test run".
这里到底发生了什么?为什么filterwarnings
会导致输出"no test ran"?