diff --git a/_pytest/compat.py b/_pytest/compat.py index 8499e8882..263305861 100644 --- a/_pytest/compat.py +++ b/_pytest/compat.py @@ -14,7 +14,6 @@ import py import _pytest from _pytest.outcomes import TEST_OUTCOME - try: import enum except ImportError: # pragma: no cover @@ -110,11 +109,10 @@ def getfuncargnames(function, is_method=False, cls=None): # ordered mapping of parameter names to Parameter instances. This # creates a tuple of the names of the parameters that don't have # defaults. - arg_names = tuple( - p.name for p in signature(function).parameters.values() - if (p.kind is Parameter.POSITIONAL_OR_KEYWORD - or p.kind is Parameter.KEYWORD_ONLY) and - p.default is Parameter.empty) + arg_names = tuple(p.name for p in signature(function).parameters.values() + if (p.kind is Parameter.POSITIONAL_OR_KEYWORD or + p.kind is Parameter.KEYWORD_ONLY) and + p.default is Parameter.empty) # If this function should be treated as a bound method even though # it's passed as an unbound method or function, remove the first # parameter name. @@ -173,8 +171,6 @@ else: STRING_TYPES = bytes, str, unicode UNICODE_TYPES = unicode, - from itertools import imap, izip # NOQA - def ascii_escaped(val): """In py2 bytes and str are the same type, so return if it's a bytes object, return it unchanged if it is a full ascii string, diff --git a/_pytest/pytester.py b/_pytest/pytester.py index 345a1acd0..a65e3f027 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -23,9 +23,7 @@ from _pytest.main import Session, EXIT_OK from _pytest.assertion.rewrite import AssertionRewritingHook -PYTEST_FULLPATH = os.path.abspath( - pytest.__file__.rstrip("oc") - ).replace("$py.class", ".py") +PYTEST_FULLPATH = os.path.abspath(pytest.__file__.rstrip("oc")).replace("$py.class", ".py") def pytest_addoption(parser): diff --git a/_pytest/recwarn.py b/_pytest/recwarn.py index c9f86a483..4fceb10a7 100644 --- a/_pytest/recwarn.py +++ b/_pytest/recwarn.py @@ -232,7 +232,5 @@ class WarningsChecker(WarningsRecorder): else: fail("DID NOT WARN. No warnings of type {0} matching" " ('{1}') was emitted. The list of emitted warnings" - " is: {2}.".format( - self.expected_warning, - self.match_expr, - [each.message for each in self])) + " is: {2}.".format(self.expected_warning, self.match_expr, + [each.message for each in self])) diff --git a/testing/logging/test_fixture.py b/testing/logging/test_fixture.py index b5bee4233..c27b31137 100644 --- a/testing/logging/test_fixture.py +++ b/testing/logging/test_fixture.py @@ -3,7 +3,7 @@ import logging logger = logging.getLogger(__name__) -sublogger = logging.getLogger(__name__+'.baz') +sublogger = logging.getLogger(__name__ + '.baz') def test_fixture_help(testdir):