Pytest Logging: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
=Internal=
=Internal=
* [[Pytest#Subjects|Pytest]]
* [[Pytest#Subjects|Pytest]]
=Overview=
<code>pytest</code> captures the <font color=darkkhaki>stdout and stderr</font> generated while running the tests, and that is why they cannot be seen in the running terminal, <font color=darkkhaki>unless the test fails</font>. To disable this behavior and allow <font color=darkkhaki>stdout and stderr</font>  propagation, start <code>pytest</code> with:
<font size=-1>
pytest -s|--capture=no ...
</font>

Latest revision as of 05:39, 9 June 2022

External

Internal

Overview

pytest captures the stdout and stderr generated while running the tests, and that is why they cannot be seen in the running terminal, unless the test fails. To disable this behavior and allow stdout and stderr propagation, start pytest with:

pytest -s|--capture=no ...