Test that deprecated_call keeps internal warnings structures intact
This commit is contained in:
parent
75679f08c9
commit
9fb1637ce2
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue