Check `deprecated_call` specific to deprecation
`deprecated_call` used to accept any warning. As of #897, it is now specific to DeprecationWarnings, and another commit in this PR extends this to PendingDeprecationWarnings. This commit makes sure this stays the case.
This commit is contained in:
parent
e8261e0c77
commit
4194c9cce2
|
@ -1,6 +1,11 @@
|
|||
2.8.1.dev
|
||||
---------
|
||||
|
||||
- 'deprecated_call' is now only satisfied with a DeprecationWarning or
|
||||
PendingDeprecationWarning. Before 2.8.0, it accepted any warning, and 2.8.0
|
||||
made it accept only DeprecationWarning (but not PendingDeprecationWarning).
|
||||
Thanks Alex Gaynor for the issue and Eric Hunsberger for the PR.
|
||||
|
||||
- fix issue #1073: avoid calling __getattr__ on potential plugin objects.
|
||||
This fixes an incompatibility with pytest-django. Thanks Andreas Pelme,
|
||||
Bruno Oliveira and Ronny Pfannschmidt for contributing and Holger Krekel
|
||||
|
|
|
@ -115,6 +115,14 @@ class TestDeprecatedCall(object):
|
|||
f = lambda: py.std.warnings.warn(PendingDeprecationWarning("hi"))
|
||||
pytest.deprecated_call(f)
|
||||
|
||||
def test_deprecated_call_specificity(self):
|
||||
other_warnings = [Warning, UserWarning, SyntaxWarning, RuntimeWarning,
|
||||
FutureWarning, ImportWarning, UnicodeWarning]
|
||||
for warning in other_warnings:
|
||||
f = lambda: py.std.warnings.warn(warning("hi"))
|
||||
with pytest.raises(AssertionError):
|
||||
pytest.deprecated_call(f)
|
||||
|
||||
|
||||
class TestWarns(object):
|
||||
def test_strings(self):
|
||||
|
|
Loading…
Reference in New Issue