diff --git a/CHANGELOG b/CHANGELOG index 771de3f4f..4d569d5c5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/testing/test_recwarn.py b/testing/test_recwarn.py index 08436c9fc..03bbd1eb4 100644 --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -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):