[issue20131] warnings module offers no documented, programmatic way to reset "seen-warning" flag

Andreas Kloeckner report at bugs.python.org
Sun Jan 5 13:39:29 CET 2014


New submission from Andreas Kloeckner:

For tests and doctests, it is often desirable to show or verify that a certain warning occurs. Unfortunately, if the warning has been hit previously, it will not be issued again. It would be great if there were a documented, unified way to reset this 'seen' flag.

Related stackoverflow posts showing that I'm not the first person to have this need:

* https://stackoverflow.com/questions/19428761/python-showing-once-warnings-again-resetting-all-warning-registries
* https://stackoverflow.com/questions/2418570/testing-warnings-with-doctest

Neither of these has a satisfactory solution.

----------
components: Library (Lib)
messages: 207372
nosy: inducer
priority: normal
severity: normal
status: open
title: warnings module offers no documented, programmatic way to reset "seen-warning" flag
versions: Python 2.7, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20131>
_______________________________________


More information about the Python-bugs-list mailing list