怎么通过pytest --debug命令查看信息
时间: 2023-08-12 15:06:09 浏览: 155
运行pytest --debug命令可以查看pytest的调试信息,例如:
```
$ pytest --debug
============================= test session starts ==============================
platform linux -- Python 3.8.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/user/project
plugins: xdist-2.2.1, forked-1.3.0, cov-2.11.1, timeout-1.4.2, html-3.1.1, metadata-1.11.0
collecting ... collected 3 items
test_demo.py::test_one PASSED
test_demo.py::test_two PASSED
test_demo.py::test_three PASSED
============================== 3 passed in 0.10s ===============================
```
在上面的输出中,可以看到pytest的一些基本信息,例如Python版本、pytest版本、插件信息、测试用例数量、测试结果等。如果有错误或者警告信息,也会在这里显示出来。这些信息可以帮助您定位问题所在,进而进行调试和修复。
阅读全文
相关推荐


















