Damn. warnings.resetwarnings() doesn't really """Reset the list of warnings filters to its default state.""" if by "its default state" one means (as I do <wink>) its initial state upon importing the warnings module. I had the clever idea of calling warnings.resetwarnings() in regrtest.py after running each test, at least so that the damage done by a sloppy overly-general warning suppression added by one test couldn't hurt error reporting in other tests. But an unwanted side effect is that I'm getting brand new "surprise" warnings now, because warnings.py does filterwarnings("ignore", category=OverflowWarning, append=1) as part of its initialization, but resetwarnings nukes that. What should resetwarnings really do? Offhand it looks most reasonable to me to move the module initialization code _processoptions(sys.warnoptions) filterwarnings("ignore", category=OverflowWarning, append=1) into the body of resetwarnings(), then call the latter from the initialization block. Objections?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4