How can I see normal print output created during pytest run?

后端 未结 11 2034
轮回少年
轮回少年 2020-12-12 10:30

Sometimes I want to just insert some print statements in my code, and see what gets printed out when I exercise it. My usual way to \"exercise\" it is with existing pytest t

11条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 10:49

    When running the test use the -s option. All print statements in exampletest.py would get printed on the console when test is run.

    py.test exampletest.py -s
    

提交回复
热议问题