How to print to console in pytest?

后端 未结 6 1586
盖世英雄少女心
盖世英雄少女心 2020-12-12 12:13

I\'m trying to use TDD (test-driven development) with pytest. pytest will not print to the console when I use print.

6条回答
  •  半阙折子戏
    2020-12-12 12:31

    According to the pytest docs, pytest --capture=sys should work. If you want to capture standard out inside a test, refer to the capsys fixture.

提交回复
热议问题