From f7747f5dd652694ce1357ea633787cb772627bef Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 10 Jul 2019 13:27:28 +0300 Subject: [PATCH] Remove references to old-style classes in a couple error messages These don't exist in Python 3. --- src/_pytest/python_api.py | 5 +---- src/_pytest/recwarn.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 82305bb1c..7c63a3588 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -647,10 +647,7 @@ def raises(expected_exception, *args, match=None, **kwargs): for exc in filterfalse( inspect.isclass, always_iterable(expected_exception, BASE_TYPE) ): - msg = ( - "exceptions must be old-style classes or" - " derived from BaseException, not %s" - ) + msg = "exceptions must be derived from BaseException, not %s" raise TypeError(msg % type(exc)) message = "DID NOT RAISE {}".format(expected_exception) diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 3ab83d1e3..b124c69d5 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -151,7 +151,7 @@ class WarningsChecker(WarningsRecorder): def __init__(self, expected_warning=None, match_expr=None): super().__init__() - msg = "exceptions must be old-style classes or derived from Warning, not %s" + msg = "exceptions must be derived from Warning, not %s" if isinstance(expected_warning, tuple): for exc in expected_warning: if not inspect.isclass(exc):