Pytest Logging: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
Line 6: Line 6:
=Overview=
=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. To disable this behavior and allow <font color=darkkhaki>stdout and stderr</font>  propagation, start <code>pytest</code> with:
<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>  
<font size=-1>  
  pytest -s|--capture=no ...
  pytest -s|--capture=no ...
</font>
</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 ...