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 <rep...@bugs.python.org>
<http://bugs.python.org/issue20131>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to