O'Reilly logo
  • Chris Kang thinks this is interesting:

pytest usually captures the output from your tests and the code under test. This includes print statements. The captured output is displayed for failing tests only after the full test session is complete

From

Cover of Python Testing with pytest

Note

When you're using "capsys" as a fixture, all print strings are catpured and does not show up on the console. You can use "-s" option to disable this and have all print show up on the console where the test is run.