[New-bugs-announce] [issue28688] Warning -- warnings.filters was modified by test_warnings

STINNER Victor report at bugs.python.org
Mon Nov 14 07:56:46 EST 2016


New submission from STINNER Victor:

The issue #23839 modified the test runner to always clear caches before running tests. As a side effect, test_warnings started to complain with:

Warning -- warnings.filters was modified by test_warnings

The issue comes from the following function of test_warnings/__init__.py:

def setUpModule():
    py_warnings.onceregistry.clear()
    c_warnings.onceregistry.clear()

I suggest to rewrite this function as a setUp/tearDown method in BaseTest and *restores* the old value of these dictionaries.

I guess that the bug affects all Python versions, even if only Python 3.7 logs a warning.

----------
components: Tests
messages: 280767
nosy: haypo, martin.panter, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Warning -- warnings.filters was modified by test_warnings
versions: Python 3.7

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


More information about the New-bugs-announce mailing list