Skip to content

Commit

Permalink
Fix additional linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Oct 24, 2017
1 parent 6821d36 commit 6b86b0d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions _pytest/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import _pytest
from _pytest.outcomes import TEST_OUTCOME


try:
import enum
except ImportError: # pragma: no cover
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -173,8 +171,6 @@ def ascii_escaped(val):
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,
Expand Down
4 changes: 1 addition & 3 deletions _pytest/pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
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):
Expand Down
6 changes: 2 additions & 4 deletions _pytest/recwarn.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,5 @@ def __exit__(self, *exc_info):
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]))
2 changes: 1 addition & 1 deletion testing/logging/test_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


logger = logging.getLogger(__name__)
sublogger = logging.getLogger(__name__+'.baz')
sublogger = logging.getLogger(__name__ + '.baz')


def test_fixture_help(testdir):
Expand Down

0 comments on commit 6b86b0d

Please sign in to comment.