[issue18383] test_warnings modifies warnings.filters when running with "-W default"

Alex Shkop report at bugs.python.org
Thu Apr 9 15:34:35 CEST 2015


Alex Shkop added the comment:

So, there are actually two issues, both of them causing the original warning. 

First issue was pointed out by Florent Xicluna. warnings.filterwarnings() method can create duplicates in warnings.filters.

Second issue is that assertWarns() works incorrectly in test_warnings.py due to use of import_fresh_module(). This produced original warning even without -Wd flag.

I attached a patch that fixes both issues for review. It includes a fix of previous patch, so no new warnings are produced. But perhaps we should separate these issues and create two patches.

----------
Added file: http://bugs.python.org/file38876/issue18383_assert_warns_and_dups.patch

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


More information about the Python-bugs-list mailing list