Fixed E126 flake8 errors
continuation line over-indented for hanging indent
This commit is contained in:
parent
92e2cd9c68
commit
e855a79dd4
|
@ -102,7 +102,7 @@ def directory_arg(path, optname):
|
||||||
_preinit = []
|
_preinit = []
|
||||||
|
|
||||||
default_plugins = (
|
default_plugins = (
|
||||||
"mark main terminal runner python fixtures debugging unittest capture skipping "
|
"mark main terminal runner python fixtures debugging unittest capture skipping "
|
||||||
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion "
|
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion "
|
||||||
"junitxml resultlog doctest cacheprovider freeze_support "
|
"junitxml resultlog doctest cacheprovider freeze_support "
|
||||||
"setuponly setupplan warnings").split()
|
"setuponly setupplan warnings").split()
|
||||||
|
@ -161,7 +161,7 @@ def _prepareconfig(args=None, plugins=None):
|
||||||
if warning:
|
if warning:
|
||||||
config.warn('C1', warning)
|
config.warn('C1', warning)
|
||||||
return pluginmanager.hook.pytest_cmdline_parse(
|
return pluginmanager.hook.pytest_cmdline_parse(
|
||||||
pluginmanager=pluginmanager, args=args)
|
pluginmanager=pluginmanager, args=args)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
config._ensure_unconfigure()
|
config._ensure_unconfigure()
|
||||||
raise
|
raise
|
||||||
|
@ -235,7 +235,7 @@ class PytestPluginManager(PluginManager):
|
||||||
|
|
||||||
def parse_hookspec_opts(self, module_or_class, name):
|
def parse_hookspec_opts(self, module_or_class, name):
|
||||||
opts = super(PytestPluginManager, self).parse_hookspec_opts(
|
opts = super(PytestPluginManager, self).parse_hookspec_opts(
|
||||||
module_or_class, name)
|
module_or_class, name)
|
||||||
if opts is None:
|
if opts is None:
|
||||||
method = getattr(module_or_class, name)
|
method = getattr(module_or_class, name)
|
||||||
if name.startswith("pytest_"):
|
if name.startswith("pytest_"):
|
||||||
|
@ -258,7 +258,7 @@ class PytestPluginManager(PluginManager):
|
||||||
ret = super(PytestPluginManager, self).register(plugin, name)
|
ret = super(PytestPluginManager, self).register(plugin, name)
|
||||||
if ret:
|
if ret:
|
||||||
self.hook.pytest_plugin_registered.call_historic(
|
self.hook.pytest_plugin_registered.call_historic(
|
||||||
kwargs=dict(plugin=plugin, manager=self))
|
kwargs=dict(plugin=plugin, manager=self))
|
||||||
|
|
||||||
if isinstance(plugin, types.ModuleType):
|
if isinstance(plugin, types.ModuleType):
|
||||||
self.consider_module(plugin)
|
self.consider_module(plugin)
|
||||||
|
@ -1099,10 +1099,10 @@ class Config(object):
|
||||||
def parse(self, args, addopts=True):
|
def parse(self, args, addopts=True):
|
||||||
# parse given cmdline arguments into this config object.
|
# parse given cmdline arguments into this config object.
|
||||||
assert not hasattr(self, 'args'), (
|
assert not hasattr(self, 'args'), (
|
||||||
"can only parse cmdline args at most once per Config object")
|
"can only parse cmdline args at most once per Config object")
|
||||||
self._origargs = args
|
self._origargs = args
|
||||||
self.hook.pytest_addhooks.call_historic(
|
self.hook.pytest_addhooks.call_historic(
|
||||||
kwargs=dict(pluginmanager=self.pluginmanager))
|
kwargs=dict(pluginmanager=self.pluginmanager))
|
||||||
self._preparse(args, addopts=addopts)
|
self._preparse(args, addopts=addopts)
|
||||||
# XXX deprecated hook:
|
# XXX deprecated hook:
|
||||||
self.hook.pytest_cmdline_preparse(config=self, args=args)
|
self.hook.pytest_cmdline_preparse(config=self, args=args)
|
||||||
|
|
|
@ -8,7 +8,7 @@ be removed when the time comes.
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
MAIN_STR_ARGS = 'passing a string to pytest.main() is deprecated, ' \
|
MAIN_STR_ARGS = 'passing a string to pytest.main() is deprecated, ' \
|
||||||
'pass a list of arguments instead.'
|
'pass a list of arguments instead.'
|
||||||
|
|
||||||
YIELD_TESTS = 'yield tests are deprecated, and scheduled to be removed in pytest 4.0'
|
YIELD_TESTS = 'yield tests are deprecated, and scheduled to be removed in pytest 4.0'
|
||||||
|
|
||||||
|
|
|
@ -172,9 +172,9 @@ def reorder_items_atscope(items, ignore, argkeys_cache, scopenum):
|
||||||
items_done = []
|
items_done = []
|
||||||
while 1:
|
while 1:
|
||||||
items_before, items_same, items_other, newignore = \
|
items_before, items_same, items_other, newignore = \
|
||||||
slice_items(items, ignore, argkeys_cache[scopenum])
|
slice_items(items, ignore, argkeys_cache[scopenum])
|
||||||
items_before = reorder_items_atscope(
|
items_before = reorder_items_atscope(
|
||||||
items_before, ignore, argkeys_cache,scopenum+1)
|
items_before, ignore, argkeys_cache,scopenum+1)
|
||||||
if items_same is None:
|
if items_same is None:
|
||||||
# nothing to reorder in this scope
|
# nothing to reorder in this scope
|
||||||
assert items_other is None
|
assert items_other is None
|
||||||
|
@ -826,7 +826,7 @@ class FixtureFunctionMarker:
|
||||||
def __call__(self, function):
|
def __call__(self, function):
|
||||||
if isclass(function):
|
if isclass(function):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"class fixtures not supported (may be in the future)")
|
"class fixtures not supported (may be in the future)")
|
||||||
function._pytestfixturefunction = self
|
function._pytestfixturefunction = self
|
||||||
return function
|
return function
|
||||||
|
|
||||||
|
@ -873,7 +873,7 @@ def fixture(scope="function", params=None, autouse=False, ids=None, name=None):
|
||||||
if callable(scope) and params is None and autouse == False:
|
if callable(scope) and params is None and autouse == False:
|
||||||
# direct decoration
|
# direct decoration
|
||||||
return FixtureFunctionMarker(
|
return FixtureFunctionMarker(
|
||||||
"function", params, autouse, name=name)(scope)
|
"function", params, autouse, name=name)(scope)
|
||||||
if params is not None and not isinstance(params, (list, tuple)):
|
if params is not None and not isinstance(params, (list, tuple)):
|
||||||
params = list(params)
|
params = list(params)
|
||||||
return FixtureFunctionMarker(scope, params, autouse, ids=ids, name=name)
|
return FixtureFunctionMarker(scope, params, autouse, ids=ids, name=name)
|
||||||
|
@ -888,7 +888,7 @@ def yield_fixture(scope="function", params=None, autouse=False, ids=None, name=N
|
||||||
if callable(scope) and params is None and not autouse:
|
if callable(scope) and params is None and not autouse:
|
||||||
# direct decoration
|
# direct decoration
|
||||||
return FixtureFunctionMarker(
|
return FixtureFunctionMarker(
|
||||||
"function", params, autouse, ids=ids, name=name)(scope)
|
"function", params, autouse, ids=ids, name=name)(scope)
|
||||||
else:
|
else:
|
||||||
return FixtureFunctionMarker(scope, params, autouse, ids=ids, name=name)
|
return FixtureFunctionMarker(scope, params, autouse, ids=ids, name=name)
|
||||||
|
|
||||||
|
|
|
@ -444,9 +444,9 @@ class LogXML(object):
|
||||||
"""
|
"""
|
||||||
if self.global_properties:
|
if self.global_properties:
|
||||||
return Junit.properties(
|
return Junit.properties(
|
||||||
[
|
[
|
||||||
Junit.property(name=name, value=value)
|
Junit.property(name=name, value=value)
|
||||||
for name, value in self.global_properties
|
for name, value in self.global_properties
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
return ''
|
return ''
|
||||||
|
|
|
@ -71,9 +71,9 @@ def annotated_getattr(obj, name, ann):
|
||||||
obj = getattr(obj, name)
|
obj = getattr(obj, name)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise AttributeError(
|
raise AttributeError(
|
||||||
'%r object at %s has no attribute %r' % (
|
'%r object at %s has no attribute %r' % (
|
||||||
type(obj).__name__, ann, name
|
type(obj).__name__, ann, name
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ def pytest_addoption(parser):
|
||||||
|
|
||||||
parser.addoption('--runpytest', default="inprocess", dest="runpytest",
|
parser.addoption('--runpytest', default="inprocess", dest="runpytest",
|
||||||
choices=("inprocess", "subprocess", ),
|
choices=("inprocess", "subprocess", ),
|
||||||
help=("run pytest sub runs in tests using an 'inprocess' "
|
help=("run pytest sub runs in tests using an 'inprocess' "
|
||||||
"or 'subprocess' (python -m main) method"))
|
"or 'subprocess' (python -m main) method"))
|
||||||
|
|
||||||
|
|
||||||
|
@ -1036,7 +1036,7 @@ def getdecoded(out):
|
||||||
return out.decode("utf-8")
|
return out.decode("utf-8")
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
return "INTERNAL not-utf8-decodeable, truncated string:\n%s" % (
|
return "INTERNAL not-utf8-decodeable, truncated string:\n%s" % (
|
||||||
py.io.saferepr(out),)
|
py.io.saferepr(out),)
|
||||||
|
|
||||||
|
|
||||||
class LineComp:
|
class LineComp:
|
||||||
|
|
|
@ -792,7 +792,7 @@ class Metafunc(fixtures.FuncargnamesCompatAttr):
|
||||||
if not parameters:
|
if not parameters:
|
||||||
fs, lineno = getfslineno(self.function)
|
fs, lineno = getfslineno(self.function)
|
||||||
reason = "got empty parameter set %r, function %s at %s:%d" % (
|
reason = "got empty parameter set %r, function %s at %s:%d" % (
|
||||||
argnames, self.function.__name__, fs, lineno)
|
argnames, self.function.__name__, fs, lineno)
|
||||||
mark = MARK_GEN.skip(reason=reason)
|
mark = MARK_GEN.skip(reason=reason)
|
||||||
parameters.append(ParameterSet(
|
parameters.append(ParameterSet(
|
||||||
values=(NOTSET,) * len(argnames),
|
values=(NOTSET,) * len(argnames),
|
||||||
|
@ -813,7 +813,7 @@ class Metafunc(fixtures.FuncargnamesCompatAttr):
|
||||||
name = 'fixture' if indirect else 'argument'
|
name = 'fixture' if indirect else 'argument'
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"%r uses no %s %r" % (
|
"%r uses no %s %r" % (
|
||||||
self.function, name, arg))
|
self.function, name, arg))
|
||||||
|
|
||||||
if indirect is True:
|
if indirect is True:
|
||||||
valtypes = dict.fromkeys(argnames, "params")
|
valtypes = dict.fromkeys(argnames, "params")
|
||||||
|
|
|
@ -135,9 +135,9 @@ def call_and_report(item, when, log=True, **kwds):
|
||||||
|
|
||||||
def check_interactive_exception(call, report):
|
def check_interactive_exception(call, report):
|
||||||
return call.excinfo and not (
|
return call.excinfo and not (
|
||||||
hasattr(report, "wasxfail") or
|
hasattr(report, "wasxfail") or
|
||||||
call.excinfo.errisinstance(skip.Exception) or
|
call.excinfo.errisinstance(skip.Exception) or
|
||||||
call.excinfo.errisinstance(bdb.BdbQuit))
|
call.excinfo.errisinstance(bdb.BdbQuit))
|
||||||
|
|
||||||
def call_runtest_hook(item, when, **kwds):
|
def call_runtest_hook(item, when, **kwds):
|
||||||
hookname = "pytest_runtest_" + when
|
hookname = "pytest_runtest_" + when
|
||||||
|
@ -365,7 +365,7 @@ class CollectReport(BaseReport):
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<CollectReport %r lenresult=%s outcome=%r>" % (
|
return "<CollectReport %r lenresult=%s outcome=%r>" % (
|
||||||
self.nodeid, len(self.result), self.outcome)
|
self.nodeid, len(self.result), self.outcome)
|
||||||
|
|
||||||
class CollectErrorRepr(TerminalRepr):
|
class CollectErrorRepr(TerminalRepr):
|
||||||
def __init__(self, msg):
|
def __init__(self, msg):
|
||||||
|
|
|
@ -537,7 +537,7 @@ def test_comment_in_statement():
|
||||||
'''
|
'''
|
||||||
for line in range(1,3):
|
for line in range(1,3):
|
||||||
assert str(getstatement(line, source)) == \
|
assert str(getstatement(line, source)) == \
|
||||||
'test(foo=1,\n # comment 1\n bar=2)'
|
'test(foo=1,\n # comment 1\n bar=2)'
|
||||||
|
|
||||||
def test_single_line_else():
|
def test_single_line_else():
|
||||||
source = getstatement(1, "if False: 2\nelse: 3")
|
source = getstatement(1, "if False: 2\nelse: 3")
|
||||||
|
|
|
@ -43,7 +43,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_exactly_equal(self):
|
def test_exactly_equal(self):
|
||||||
examples = [
|
examples = [
|
||||||
(2.0, 2.0),
|
(2.0, 2.0),
|
||||||
(0.1e200, 0.1e200),
|
(0.1e200, 0.1e200),
|
||||||
(1.123e-300, 1.123e-300),
|
(1.123e-300, 1.123e-300),
|
||||||
(12345, 12345.0),
|
(12345, 12345.0),
|
||||||
|
@ -57,7 +57,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_opposite_sign(self):
|
def test_opposite_sign(self):
|
||||||
examples = [
|
examples = [
|
||||||
(eq, 1e-100, -1e-100),
|
(eq, 1e-100, -1e-100),
|
||||||
(ne, 1e100, -1e100),
|
(ne, 1e100, -1e100),
|
||||||
]
|
]
|
||||||
for op, a, x in examples:
|
for op, a, x in examples:
|
||||||
|
@ -65,7 +65,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_zero_tolerance(self):
|
def test_zero_tolerance(self):
|
||||||
within_1e10 = [
|
within_1e10 = [
|
||||||
(1.1e-100, 1e-100),
|
(1.1e-100, 1e-100),
|
||||||
(-1.1e-100, -1e-100),
|
(-1.1e-100, -1e-100),
|
||||||
]
|
]
|
||||||
for a, x in within_1e10:
|
for a, x in within_1e10:
|
||||||
|
@ -79,11 +79,11 @@ class TestApprox(object):
|
||||||
def test_negative_tolerance(self):
|
def test_negative_tolerance(self):
|
||||||
# Negative tolerances are not allowed.
|
# Negative tolerances are not allowed.
|
||||||
illegal_kwargs = [
|
illegal_kwargs = [
|
||||||
dict(rel=-1e100),
|
dict(rel=-1e100),
|
||||||
dict(abs=-1e100),
|
dict(abs=-1e100),
|
||||||
dict(rel=1e100, abs=-1e100),
|
dict(rel=1e100, abs=-1e100),
|
||||||
dict(rel=-1e100, abs=1e100),
|
dict(rel=-1e100, abs=1e100),
|
||||||
dict(rel=-1e100, abs=-1e100),
|
dict(rel=-1e100, abs=-1e100),
|
||||||
]
|
]
|
||||||
for kwargs in illegal_kwargs:
|
for kwargs in illegal_kwargs:
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
|
@ -92,7 +92,7 @@ class TestApprox(object):
|
||||||
def test_inf_tolerance(self):
|
def test_inf_tolerance(self):
|
||||||
# Everything should be equal if the tolerance is infinite.
|
# Everything should be equal if the tolerance is infinite.
|
||||||
large_diffs = [
|
large_diffs = [
|
||||||
(1, 1000),
|
(1, 1000),
|
||||||
(1e-50, 1e50),
|
(1e-50, 1e50),
|
||||||
(-1.0, -1e300),
|
(-1.0, -1e300),
|
||||||
(0.0, 10),
|
(0.0, 10),
|
||||||
|
@ -107,8 +107,8 @@ class TestApprox(object):
|
||||||
# If the relative tolerance is zero but the expected value is infinite,
|
# If the relative tolerance is zero but the expected value is infinite,
|
||||||
# the actual tolerance is a NaN, which should be an error.
|
# the actual tolerance is a NaN, which should be an error.
|
||||||
illegal_kwargs = [
|
illegal_kwargs = [
|
||||||
dict(rel=inf, abs=0.0),
|
dict(rel=inf, abs=0.0),
|
||||||
dict(rel=inf, abs=inf),
|
dict(rel=inf, abs=inf),
|
||||||
]
|
]
|
||||||
for kwargs in illegal_kwargs:
|
for kwargs in illegal_kwargs:
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
|
@ -116,9 +116,9 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_nan_tolerance(self):
|
def test_nan_tolerance(self):
|
||||||
illegal_kwargs = [
|
illegal_kwargs = [
|
||||||
dict(rel=nan),
|
dict(rel=nan),
|
||||||
dict(abs=nan),
|
dict(abs=nan),
|
||||||
dict(rel=nan, abs=nan),
|
dict(rel=nan, abs=nan),
|
||||||
]
|
]
|
||||||
for kwargs in illegal_kwargs:
|
for kwargs in illegal_kwargs:
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
|
@ -135,7 +135,7 @@ class TestApprox(object):
|
||||||
# None of the other tests (except the doctests) should be affected by
|
# None of the other tests (except the doctests) should be affected by
|
||||||
# the choice of defaults.
|
# the choice of defaults.
|
||||||
examples = [
|
examples = [
|
||||||
# Relative tolerance used.
|
# Relative tolerance used.
|
||||||
(eq, 1e100 + 1e94, 1e100),
|
(eq, 1e100 + 1e94, 1e100),
|
||||||
(ne, 1e100 + 2e94, 1e100),
|
(ne, 1e100 + 2e94, 1e100),
|
||||||
(eq, 1e0 + 1e-6, 1e0),
|
(eq, 1e0 + 1e-6, 1e0),
|
||||||
|
@ -166,7 +166,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_relative_tolerance(self):
|
def test_relative_tolerance(self):
|
||||||
within_1e8_rel = [
|
within_1e8_rel = [
|
||||||
(1e8 + 1e0, 1e8),
|
(1e8 + 1e0, 1e8),
|
||||||
(1e0 + 1e-8, 1e0),
|
(1e0 + 1e-8, 1e0),
|
||||||
(1e-8 + 1e-16, 1e-8),
|
(1e-8 + 1e-16, 1e-8),
|
||||||
]
|
]
|
||||||
|
@ -176,7 +176,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_absolute_tolerance(self):
|
def test_absolute_tolerance(self):
|
||||||
within_1e8_abs = [
|
within_1e8_abs = [
|
||||||
(1e8 + 9e-9, 1e8),
|
(1e8 + 9e-9, 1e8),
|
||||||
(1e0 + 9e-9, 1e0),
|
(1e0 + 9e-9, 1e0),
|
||||||
(1e-8 + 9e-9, 1e-8),
|
(1e-8 + 9e-9, 1e-8),
|
||||||
]
|
]
|
||||||
|
@ -201,7 +201,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_expecting_inf(self):
|
def test_expecting_inf(self):
|
||||||
examples = [
|
examples = [
|
||||||
(eq, inf, inf),
|
(eq, inf, inf),
|
||||||
(eq, -inf, -inf),
|
(eq, -inf, -inf),
|
||||||
(ne, inf, -inf),
|
(ne, inf, -inf),
|
||||||
(ne, 0.0, inf),
|
(ne, 0.0, inf),
|
||||||
|
@ -212,7 +212,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_expecting_nan(self):
|
def test_expecting_nan(self):
|
||||||
examples = [
|
examples = [
|
||||||
(nan, nan),
|
(nan, nan),
|
||||||
(-nan, -nan),
|
(-nan, -nan),
|
||||||
(nan, -nan),
|
(nan, -nan),
|
||||||
(0.0, nan),
|
(0.0, nan),
|
||||||
|
@ -230,7 +230,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_expecting_sequence(self):
|
def test_expecting_sequence(self):
|
||||||
within_1e8 = [
|
within_1e8 = [
|
||||||
(1e8 + 1e0, 1e8),
|
(1e8 + 1e0, 1e8),
|
||||||
(1e0 + 1e-8, 1e0),
|
(1e0 + 1e-8, 1e0),
|
||||||
(1e-8 + 1e-16, 1e-8),
|
(1e-8 + 1e-16, 1e-8),
|
||||||
]
|
]
|
||||||
|
@ -243,7 +243,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_complex(self):
|
def test_complex(self):
|
||||||
within_1e6 = [
|
within_1e6 = [
|
||||||
( 1.000001 + 1.0j, 1.0 + 1.0j),
|
( 1.000001 + 1.0j, 1.0 + 1.0j),
|
||||||
(1.0 + 1.000001j, 1.0 + 1.0j),
|
(1.0 + 1.000001j, 1.0 + 1.0j),
|
||||||
(-1.000001 + 1.0j, -1.0 + 1.0j),
|
(-1.000001 + 1.0j, -1.0 + 1.0j),
|
||||||
(1.0 - 1.000001j, 1.0 - 1.0j),
|
(1.0 - 1.000001j, 1.0 - 1.0j),
|
||||||
|
@ -254,7 +254,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_int(self):
|
def test_int(self):
|
||||||
within_1e6 = [
|
within_1e6 = [
|
||||||
(1000001, 1000000),
|
(1000001, 1000000),
|
||||||
(-1000001, -1000000),
|
(-1000001, -1000000),
|
||||||
]
|
]
|
||||||
for a, x in within_1e6:
|
for a, x in within_1e6:
|
||||||
|
@ -263,7 +263,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_decimal(self):
|
def test_decimal(self):
|
||||||
within_1e6 = [
|
within_1e6 = [
|
||||||
(Decimal('1.000001'), Decimal('1.0')),
|
(Decimal('1.000001'), Decimal('1.0')),
|
||||||
(Decimal('-1.000001'), Decimal('-1.0')),
|
(Decimal('-1.000001'), Decimal('-1.0')),
|
||||||
]
|
]
|
||||||
for a, x in within_1e6:
|
for a, x in within_1e6:
|
||||||
|
@ -272,7 +272,7 @@ class TestApprox(object):
|
||||||
|
|
||||||
def test_fraction(self):
|
def test_fraction(self):
|
||||||
within_1e6 = [
|
within_1e6 = [
|
||||||
(1 + Fraction(1, 1000000), Fraction(1)),
|
(1 + Fraction(1, 1000000), Fraction(1)),
|
||||||
(-1 - Fraction(-1, 1000000), Fraction(-1)),
|
(-1 - Fraction(-1, 1000000), Fraction(-1)),
|
||||||
]
|
]
|
||||||
for a, x in within_1e6:
|
for a, x in within_1e6:
|
||||||
|
@ -282,10 +282,10 @@ class TestApprox(object):
|
||||||
def test_doctests(self):
|
def test_doctests(self):
|
||||||
parser = doctest.DocTestParser()
|
parser = doctest.DocTestParser()
|
||||||
test = parser.get_doctest(
|
test = parser.get_doctest(
|
||||||
approx.__doc__,
|
approx.__doc__,
|
||||||
{'approx': approx},
|
{'approx': approx},
|
||||||
approx.__name__,
|
approx.__name__,
|
||||||
None, None,
|
None, None,
|
||||||
)
|
)
|
||||||
runner = MyDocTestRunner()
|
runner = MyDocTestRunner()
|
||||||
runner.run(test)
|
runner.run(test)
|
||||||
|
|
|
@ -772,7 +772,7 @@ def test_assertrepr_loaded_per_dir(testdir):
|
||||||
b_conftest.write('def pytest_assertrepr_compare(): return ["summary b"]')
|
b_conftest.write('def pytest_assertrepr_compare(): return ["summary b"]')
|
||||||
result = testdir.runpytest()
|
result = testdir.runpytest()
|
||||||
result.stdout.fnmatch_lines([
|
result.stdout.fnmatch_lines([
|
||||||
'*def test_base():*',
|
'*def test_base():*',
|
||||||
'*E*assert 1 == 2*',
|
'*E*assert 1 == 2*',
|
||||||
'*def test_a():*',
|
'*def test_a():*',
|
||||||
'*E*assert summary a*',
|
'*E*assert summary a*',
|
||||||
|
|
|
@ -200,7 +200,7 @@ def test_strict_prohibits_unregistered_markers(testdir):
|
||||||
])
|
])
|
||||||
|
|
||||||
@pytest.mark.parametrize("spec", [
|
@pytest.mark.parametrize("spec", [
|
||||||
("xyz", ("test_one",)),
|
("xyz", ("test_one",)),
|
||||||
("xyz and xyz2", ()),
|
("xyz and xyz2", ()),
|
||||||
("xyz2", ("test_two",)),
|
("xyz2", ("test_two",)),
|
||||||
("xyz or xyz2", ("test_one", "test_two"),)
|
("xyz or xyz2", ("test_one", "test_two"),)
|
||||||
|
@ -223,7 +223,7 @@ def test_mark_option(spec, testdir):
|
||||||
assert list(passed) == list(passed_result)
|
assert list(passed) == list(passed_result)
|
||||||
|
|
||||||
@pytest.mark.parametrize("spec", [
|
@pytest.mark.parametrize("spec", [
|
||||||
("interface", ("test_interface",)),
|
("interface", ("test_interface",)),
|
||||||
("not interface", ("test_nointer",)),
|
("not interface", ("test_nointer",)),
|
||||||
])
|
])
|
||||||
def test_mark_option_custom(spec, testdir):
|
def test_mark_option_custom(spec, testdir):
|
||||||
|
@ -248,7 +248,7 @@ def test_mark_option_custom(spec, testdir):
|
||||||
assert list(passed) == list(passed_result)
|
assert list(passed) == list(passed_result)
|
||||||
|
|
||||||
@pytest.mark.parametrize("spec", [
|
@pytest.mark.parametrize("spec", [
|
||||||
("interface", ("test_interface",)),
|
("interface", ("test_interface",)),
|
||||||
("not interface", ("test_nointer", "test_pass")),
|
("not interface", ("test_nointer", "test_pass")),
|
||||||
("pass", ("test_pass",)),
|
("pass", ("test_pass",)),
|
||||||
("not pass", ("test_interface", "test_nointer")),
|
("not pass", ("test_interface", "test_nointer")),
|
||||||
|
@ -271,7 +271,7 @@ def test_keyword_option_custom(spec, testdir):
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("spec", [
|
@pytest.mark.parametrize("spec", [
|
||||||
("None", ("test_func[None]",)),
|
("None", ("test_func[None]",)),
|
||||||
("1.3", ("test_func[1.3]",)),
|
("1.3", ("test_func[1.3]",)),
|
||||||
("2-3", ("test_func[2-3]",))
|
("2-3", ("test_func[2-3]",))
|
||||||
])
|
])
|
||||||
|
|
|
@ -29,7 +29,7 @@ class TestPytestPluginInteractions(object):
|
||||||
config = get_config()
|
config = get_config()
|
||||||
pm = config.pluginmanager
|
pm = config.pluginmanager
|
||||||
pm.hook.pytest_addhooks.call_historic(
|
pm.hook.pytest_addhooks.call_historic(
|
||||||
kwargs=dict(pluginmanager=config.pluginmanager))
|
kwargs=dict(pluginmanager=config.pluginmanager))
|
||||||
config.pluginmanager._importconftest(conf)
|
config.pluginmanager._importconftest(conf)
|
||||||
#print(config.pluginmanager.get_plugins())
|
#print(config.pluginmanager.get_plugins())
|
||||||
res = config.hook.pytest_myhook(xyz=10)
|
res = config.hook.pytest_myhook(xyz=10)
|
||||||
|
|
|
@ -6,7 +6,7 @@ import py
|
||||||
import pytest
|
import pytest
|
||||||
from _pytest.main import Node, Item, FSCollector
|
from _pytest.main import Node, Item, FSCollector
|
||||||
from _pytest.resultlog import generic_path, ResultLog, \
|
from _pytest.resultlog import generic_path, ResultLog, \
|
||||||
pytest_configure, pytest_unconfigure
|
pytest_configure, pytest_unconfigure
|
||||||
|
|
||||||
|
|
||||||
def test_generic_path(testdir):
|
def test_generic_path(testdir):
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -196,6 +196,6 @@ filterwarnings =
|
||||||
ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning
|
ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
ignore = E126,E127,E128,E129,E131,E201,E202,E203,E221,E222,E225,E226,E231,E241,E251,E261,E262,E265,E271,E272,E293,E301,E302,E303,E401,E402,E501,E701,E702,E704,E712,E731
|
ignore = E127,E128,E129,E131,E201,E202,E203,E221,E222,E225,E226,E231,E241,E251,E261,E262,E265,E271,E272,E293,E301,E302,E303,E401,E402,E501,E701,E702,E704,E712,E731
|
||||||
max-line-length = 120
|
max-line-length = 120
|
||||||
exclude = _pytest/vendored_packages/pluggy.py
|
exclude = _pytest/vendored_packages/pluggy.py
|
||||||
|
|
Loading…
Reference in New Issue