I just ran py.test
on my code and got the following output:
================== 6 passed, 2 pytest-warnings in 40.79 seconds =======================
However, I cannot see what py.test
would like to warn me about. How can I turn on warning output to the console?
py.test --help
offers me the --strict
flag:
--strict run pytest in strict mode, warnings become errors.
However I just want to see the output, not make my tests fail.
I checked pytest.org and this question but they are only concerned with asserting warnings in python, not showing warnings generated on the commandline.
__init__
constructor to my test class, which causedpy.test
not to be able to use the test. The warning was not shown to me, even with--strict
, but your answer helped me to makepy.test
show the warning, of which the cause was still in my own code. – Sargassum