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