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
|
assert ret == 42
|
||||||
|
|
||||||
def test_deprecated_call_preserves():
|
def test_deprecated_call_preserves():
|
||||||
|
onceregistry = py.std.warnings.onceregistry.copy()
|
||||||
|
filters = py.std.warnings.filters[:]
|
||||||
warn = py.std.warnings.warn
|
warn = py.std.warnings.warn
|
||||||
warn_explicit = py.std.warnings.warn_explicit
|
warn_explicit = py.std.warnings.warn_explicit
|
||||||
test_deprecated_call_raises()
|
test_deprecated_call_raises()
|
||||||
test_deprecated_call()
|
test_deprecated_call()
|
||||||
assert warn == py.std.warnings.warn
|
assert onceregistry == py.std.warnings.onceregistry
|
||||||
assert warn_explicit == py.std.warnings.warn_explicit
|
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():
|
def test_deprecated_explicit_call_raises():
|
||||||
pytest.raises(AssertionError,
|
pytest.raises(AssertionError,
|
||||||
|
|
Loading…
Reference in New Issue