Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Indicate non-pytest warnings in the UI #1262
My library, Hypothesis potentially emits a number of warnings indicating that a test is in some way doing the wrong thing.
Currently these will only show up if the code is being run with --capture=no, or if a test actually fails. It would be useful if the user were in some way notified that their code is emitting warnings even within a passing test, because warnings might indicate that the test is passing erroneously.
Things I would ideally like to see:
I leave the exact UI up to your judgement, I just want the warnings my library is emitting to not get swallowed. :-)
changed the title from
Indicate warnings in the UI
Indicate non-pytest warnings in the UI
Dec 16, 2015
I agree test frameworks should make python warnings apparent in some way.
I use this for my own testsuite:
@pytest.yield_fixture(autouse=True) def fail_tests_on_warnings(): warnings.simplefilter('error') # https://github.com/pytest-dev/pytest-bdd/issues/153 warnings.filterwarnings('ignore', message=r'inspect.getargspec\(\) is ' r'deprecated, use inspect.signature\(\) instead', category=DeprecationWarning) yield warnings.resetwarnings()
Of course that'd be a bit harsh as a default, but maybe something like showing the warnings in the summary (and coloring it yellow), and printing the warnings if