From 9fb1637ce2320de792ebc16afca45e10caf65d8f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 26 Jun 2015 00:26:59 -0300 Subject: [PATCH] Test that deprecated_call keeps internal warnings structures intact --- testing/test_recwarn.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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,