Skip to content

Commit f7747f5

Browse files
committed
Remove references to old-style classes in a couple error messages
These don't exist in Python 3.
1 parent 602cd5e commit f7747f5

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/_pytest/python_api.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,10 +647,7 @@ def raises(expected_exception, *args, match=None, **kwargs):
647647
for exc in filterfalse(
648648
inspect.isclass, always_iterable(expected_exception, BASE_TYPE)
649649
):
650-
msg = (
651-
"exceptions must be old-style classes or"
652-
" derived from BaseException, not %s"
653-
)
650+
msg = "exceptions must be derived from BaseException, not %s"
654651
raise TypeError(msg % type(exc))
655652

656653
message = "DID NOT RAISE {}".format(expected_exception)

src/_pytest/recwarn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class WarningsChecker(WarningsRecorder):
151151
def __init__(self, expected_warning=None, match_expr=None):
152152
super().__init__()
153153

154-
msg = "exceptions must be old-style classes or derived from Warning, not %s"
154+
msg = "exceptions must be derived from Warning, not %s"
155155
if isinstance(expected_warning, tuple):
156156
for exc in expected_warning:
157157
if not inspect.isclass(exc):

0 commit comments

Comments
 (0)