Fix additional linting issues
This commit is contained in:
parent
6821d36ca5
commit
6b86b0dbfe
|
@ -14,7 +14,6 @@ import py
|
||||||
import _pytest
|
import _pytest
|
||||||
from _pytest.outcomes import TEST_OUTCOME
|
from _pytest.outcomes import TEST_OUTCOME
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import enum
|
import enum
|
||||||
except ImportError: # pragma: no cover
|
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
|
# ordered mapping of parameter names to Parameter instances. This
|
||||||
# creates a tuple of the names of the parameters that don't have
|
# creates a tuple of the names of the parameters that don't have
|
||||||
# defaults.
|
# defaults.
|
||||||
arg_names = tuple(
|
arg_names = tuple(p.name for p in signature(function).parameters.values()
|
||||||
p.name for p in signature(function).parameters.values()
|
if (p.kind is Parameter.POSITIONAL_OR_KEYWORD or
|
||||||
if (p.kind is Parameter.POSITIONAL_OR_KEYWORD
|
p.kind is Parameter.KEYWORD_ONLY) and
|
||||||
or p.kind is Parameter.KEYWORD_ONLY) and
|
p.default is Parameter.empty)
|
||||||
p.default is Parameter.empty)
|
|
||||||
# If this function should be treated as a bound method even though
|
# If this function should be treated as a bound method even though
|
||||||
# it's passed as an unbound method or function, remove the first
|
# it's passed as an unbound method or function, remove the first
|
||||||
# parameter name.
|
# parameter name.
|
||||||
|
@ -173,8 +171,6 @@ else:
|
||||||
STRING_TYPES = bytes, str, unicode
|
STRING_TYPES = bytes, str, unicode
|
||||||
UNICODE_TYPES = unicode,
|
UNICODE_TYPES = unicode,
|
||||||
|
|
||||||
from itertools import imap, izip # NOQA
|
|
||||||
|
|
||||||
def ascii_escaped(val):
|
def ascii_escaped(val):
|
||||||
"""In py2 bytes and str are the same type, so return if it's a bytes
|
"""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,
|
object, return it unchanged if it is a full ascii string,
|
||||||
|
|
|
@ -23,9 +23,7 @@ from _pytest.main import Session, EXIT_OK
|
||||||
from _pytest.assertion.rewrite import AssertionRewritingHook
|
from _pytest.assertion.rewrite import AssertionRewritingHook
|
||||||
|
|
||||||
|
|
||||||
PYTEST_FULLPATH = os.path.abspath(
|
PYTEST_FULLPATH = os.path.abspath(pytest.__file__.rstrip("oc")).replace("$py.class", ".py")
|
||||||
pytest.__file__.rstrip("oc")
|
|
||||||
).replace("$py.class", ".py")
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
|
|
|
@ -232,7 +232,5 @@ class WarningsChecker(WarningsRecorder):
|
||||||
else:
|
else:
|
||||||
fail("DID NOT WARN. No warnings of type {0} matching"
|
fail("DID NOT WARN. No warnings of type {0} matching"
|
||||||
" ('{1}') was emitted. The list of emitted warnings"
|
" ('{1}') was emitted. The list of emitted warnings"
|
||||||
" is: {2}.".format(
|
" is: {2}.".format(self.expected_warning, self.match_expr,
|
||||||
self.expected_warning,
|
[each.message for each in self]))
|
||||||
self.match_expr,
|
|
||||||
[each.message for each in self]))
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import logging
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
sublogger = logging.getLogger(__name__+'.baz')
|
sublogger = logging.getLogger(__name__ + '.baz')
|
||||||
|
|
||||||
|
|
||||||
def test_fixture_help(testdir):
|
def test_fixture_help(testdir):
|
||||||
|
|
Loading…
Reference in New Issue