diff --git a/testing/test_recwarn.py b/testing/test_recwarn.py index d3455946f..65989cb3c 100644 --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -64,12 +64,16 @@ def test_deprecated_call_ret(): assert ret == 42 def test_deprecated_call_preserves(): + onceregistry = py.std.warnings.onceregistry.copy() + filters = py.std.warnings.filters[:] warn = py.std.warnings.warn warn_explicit = py.std.warnings.warn_explicit test_deprecated_call_raises() test_deprecated_call() - assert warn == py.std.warnings.warn - assert warn_explicit == py.std.warnings.warn_explicit + assert onceregistry == py.std.warnings.onceregistry + assert filters == py.std.warnings.filters + assert warn is py.std.warnings.warn + assert warn_explicit is py.std.warnings.warn_explicit def test_deprecated_explicit_call_raises(): pytest.raises(AssertionError,