I want to turn off output in Pytest console, so i can see only my logs
I tried pytest -x -s -tb=no
but its not exactly what i want
I want to get rid of this output
======================================================== test session starts ========================================================= platform win32 -- Python 3.10.7, pytest-7.2.0, pluggy-1.0.0 rootdir: C:\Users\...\projects\autotest-lk\source collected 6 items
Any advices?
>Solution :
You can use the -q
or --quiet
option in Pytest to suppress the header and summary output, while still allowing your test logs to be displayed. Here is an example command:
pytest -q
Alternatively, you can use the -r
or --report
option to customize the output that is displayed. For example, you can use -rN
to only show the test names and status, like this:
pytest -rN
You can also combine the -q
and -r
options to suppress the header and summary output, while still showing the test names and status:
pytest -q -rN