Fix additional linting issues

This commit is contained in:
Bruno Oliveira 2017-10-24 21:01:00 -02:00
parent 6821d36ca5
commit 6b86b0dbfe
4 changed files with 8 additions and 16 deletions

View File

@ -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,

View File

@ -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):

View File

@ -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]))

View File

@ -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):