我曾经通过控制台运行pytest测试,并通过以下命令启动它:
pytest -v --tb=line
我在控制台中得到了以下输出(每个测试都有其运行状态)
test_main_page.py::test_guest_can_go_to_login_page PASSED [ 50%]
test_main_page.py::test_guest_should_see_login_link PASSED [100%]
我想在PyCharm中设置测试配置。我创建了pytest配置
Target=Custom
Additional Arguments="-v --tb=line"
当我运行此类配置参数时,它们会显示在测试控制台中,但不会根据此类参数应用输出格式
/home/user/dev/python/project/venv/bin/python /home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-C/ch-0/192.7142.56/helpers/pycharm/_jb_pytest_runner.py -- -v --tb=line
Launching pytest with arguments -v --tb=line in /home/user/dev/python/project
============================= test session starts ==============================
platform linux -- Python 3.7.5, pytest-5.2.2, py-1.8.0, pluggy-0.13.0 -- /home/user/dev/python/project/venv/bin/python
cachedir: .pytest_cache
rootdir: /home/user/dev/python/project
collecting ... collected 2 items
test_main_page.py::test_guest_can_go_to_login_page
start chrome for test..
PASSED [ 50%]
quit browser..