Test that deprecated_call keeps internal warnings structures intact

This commit is contained in:
Bruno Oliveira 2015-06-26 00:26:59 -03:00
parent 75679f08c9
commit 9fb1637ce2
1 changed files with 6 additions and 2 deletions

View File

@ -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,