I have parametrized test suite with ~10^5 tests. And I'm debugging raised errors consequently, I.e using -x
flag. Like so:
pytest tests.py -x
Problem here is that this command cluttering terminal with .
corresponding to each test. Which is not desired (cause I have no any xfaild or something - only passed or not; and due to the number of tests):
............................................................................................................................................................................................................ [ 5%]
............................................................................................................................................................................................................ [ 11%]
............................................................................................................................................................................................................ [ 17%]
How to disable this "dots" and left only progress bar? Maybe some plugin? Tried -q
but dots still printing.
You could implement the pytest_report_teststatus()
hook in your conftest.py
. It returns a tuple result-category, shortletter and verbose word.
def pytest_report_teststatus(report, config):
if report.passed and report.when == "call":
return report.outcome, "", report.outcome.upper()
The hook is called 3 times for each test, with report.when
set to "setup"
, "call"
or "teardown"
. The callback above sets the shortletter to an empty string if the test passes in the "call"
phase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With