【发布时间】:2023-02-11 03:08:52
【问题描述】:
在 PyCharm 2022.3.2(专业版)中使用 pytest (6.2.4) 和 Python 3.9 运行测试时,我在 PyCharm 控制台窗口中得到以下结果:
D:\cenv\python.exe "D:/Program Files (x86)/JetBrains/PyCharm 2022.3.2/plugins/python/helpers/pycharm/_jb_pytest_runner.py" --path D:\tests\test_k.py 测试于下午 6:49 开始...... 使用参数 D:\tests\test_k.py --no-header --no-summary -q 在 D:\tests 中启动 pytest
=============================测试会话开始================== =========== 收集 ... 收集了 5 件物品
test_k.py::test_init test_k.py::test_1 test_k.py::test_2 test_k.py::test_3 test_k.py::test_4
======================= 5 次通过,4.50 秒内有 278 次警告 =================== ====
进程结束,退出代码为 0 通过 [ 20%] 通过 [ 40%] 通过 [ 60%] 通过 [ 80%] 通过 [100%]
所以实际的警告不显示。仅显示警告数 (278)。
我试过:
选择:Pytest:不要在高级设置中添加“--no-header --no-summary -q”
在运行/调试配置窗口中将附加参数设置为 -Wall
在运行/调试配置窗口中将解释器选项设置为 -Wall
和所有排列,都无济于事。有没有办法在 PyCharm 控制台窗口中使用 PyCharm 中的 pytest 运行测试时显示所有运行时警告?
【问题讨论】:
标签: python pycharm pytest warnings