Is there a way to suppress the pytest\'s internal deprecation warnings?
Context: I\'m looking to evaluate the difficulty of porting a test suite from nose
In the pytest.ini file you can add:
[pytest]
addopts = -p no:warnings
OR passing below line in the command-line. This might be useful if your test suites handle warnings using an external system.
-p no:warnings
OR if you only want to hide some specific deprecated warning, add below statement in you pytest.ini file
[pytest]
filterwarnings =
ignore:.*U.*mode is deprecated:DeprecationWarning
This will ignore all warnings of type DeprecationWarning where the start of the message matches the regular expression ".*U.*mode is deprecated".
OR Although not recommended, you can use the
--disable-warnings
command-line option to suppress the warning summary entirely from the test run output.