During test execution any output sent to stdout
and stderr
is captured. If a test or a setup method fails its according captured output will usually be shown along with the failure traceback. (this behavior can be configured by the --show-capture
command-line option).
One primary benefit of the default capturing of stdout/stderr output is that you can use print statements for debugging:
pytest -s # disable all capturing