Small cleanups on _pytest.compat

Small improvements and cleanups
This commit is contained in:
Bruno Oliveira
2019-06-15 10:06:37 -03:00
parent 240828d912
commit 355eb5adfb
5 changed files with 25 additions and 30 deletions

View File

@@ -1,3 +1,4 @@
import inspect
import math
import pprint
import sys
@@ -13,7 +14,6 @@ from more_itertools.more import always_iterable
import _pytest._code
from _pytest import deprecated
from _pytest.compat import isclass
from _pytest.compat import STRING_TYPES
from _pytest.outcomes import fail
@@ -658,7 +658,9 @@ def raises(expected_exception, *args, **kwargs):
"""
__tracebackhide__ = True
for exc in filterfalse(isclass, always_iterable(expected_exception, BASE_TYPE)):
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"