Fixed E231 flake8 errors
missing whitespace after ‘,’, ‘;’, or ‘:’
This commit is contained in:
@@ -239,7 +239,7 @@ class TestApprox(object):
|
||||
|
||||
def test_expecting_sequence_wrong_len(self):
|
||||
assert [1, 2] != approx([1])
|
||||
assert [1, 2] != approx([1,2,3])
|
||||
assert [1, 2] != approx([1, 2, 3])
|
||||
|
||||
def test_complex(self):
|
||||
within_1e6 = [
|
||||
|
||||
@@ -421,7 +421,7 @@ class TestFunction(object):
|
||||
f1 = pytest.Function(name="name", parent=session, config=config,
|
||||
args=(1,), callobj=func1)
|
||||
assert f1 == f1
|
||||
f2 = pytest.Function(name="name",config=config,
|
||||
f2 = pytest.Function(name="name", config=config,
|
||||
callobj=func2, parent=session)
|
||||
assert f1 != f2
|
||||
|
||||
@@ -733,11 +733,11 @@ class TestSorting(object):
|
||||
assert not (fn1 == fn3)
|
||||
assert fn1 != fn3
|
||||
|
||||
for fn in fn1,fn2,fn3:
|
||||
for fn in fn1, fn2, fn3:
|
||||
assert fn != 3
|
||||
assert fn != modcol
|
||||
assert fn != [1,2,3]
|
||||
assert [1,2,3] != fn
|
||||
assert fn != [1, 2, 3]
|
||||
assert [1, 2, 3] != fn
|
||||
assert modcol != fn
|
||||
|
||||
def test_allow_sane_sorting_for_decorators(self, testdir):
|
||||
|
||||
@@ -25,7 +25,7 @@ def test_getfuncargnames():
|
||||
pass
|
||||
|
||||
assert fixtures.getfuncargnames(A().f) == ('arg1',)
|
||||
if sys.version_info < (3,0):
|
||||
if sys.version_info < (3, 0):
|
||||
assert fixtures.getfuncargnames(A.f) == ('arg1',)
|
||||
|
||||
class TestFillFixtures(object):
|
||||
@@ -817,7 +817,7 @@ class TestRequestBasic(object):
|
||||
|
||||
class TestRequestMarking(object):
|
||||
def test_applymarker(self, testdir):
|
||||
item1,item2 = testdir.getitems("""
|
||||
item1, item2 = testdir.getitems("""
|
||||
import pytest
|
||||
|
||||
@pytest.fixture
|
||||
@@ -1297,7 +1297,7 @@ class TestFixtureUsages(object):
|
||||
reprec = testdir.inline_run("-v")
|
||||
reprec.assertoutcome(passed=4)
|
||||
l = reprec.getcalls("pytest_runtest_call")[0].item.module.l
|
||||
assert l == [1,2, 10,20]
|
||||
assert l == [1, 2, 10, 20]
|
||||
|
||||
|
||||
class TestFixtureManagerParseFactories(object):
|
||||
@@ -1706,7 +1706,7 @@ class TestAutouseManagement(object):
|
||||
pass
|
||||
""")
|
||||
confcut = "--confcutdir={0}".format(testdir.tmpdir)
|
||||
reprec = testdir.inline_run("-v","-s", confcut)
|
||||
reprec = testdir.inline_run("-v", "-s", confcut)
|
||||
reprec.assertoutcome(passed=8)
|
||||
config = reprec.getcalls("pytest_unconfigure")[0].config
|
||||
l = config.pluginmanager._getconftestmodules(p)[0].l
|
||||
@@ -1776,8 +1776,8 @@ class TestAutouseManagement(object):
|
||||
reprec.assertoutcome(passed=1)
|
||||
|
||||
@pytest.mark.issue226
|
||||
@pytest.mark.parametrize("param1", ["", "params=[1]"], ids=["p00","p01"])
|
||||
@pytest.mark.parametrize("param2", ["", "params=[1]"], ids=["p10","p11"])
|
||||
@pytest.mark.parametrize("param1", ["", "params=[1]"], ids=["p00", "p01"])
|
||||
@pytest.mark.parametrize("param2", ["", "params=[1]"], ids=["p10", "p11"])
|
||||
def test_ordering_dependencies_torndown_first(self, testdir, param1, param2):
|
||||
testdir.makepyfile("""
|
||||
import pytest
|
||||
@@ -2108,7 +2108,7 @@ class TestFixtureMarker(object):
|
||||
reprec = testdir.inline_run("-v")
|
||||
reprec.assertoutcome(passed=4)
|
||||
l = reprec.getcalls("pytest_runtest_call")[0].item.module.l
|
||||
assert l == [1,1,2,2]
|
||||
assert l == [1, 1, 2, 2]
|
||||
|
||||
def test_module_parametrized_ordering(self, testdir):
|
||||
testdir.makeconftest("""
|
||||
@@ -2351,7 +2351,7 @@ class TestFixtureMarker(object):
|
||||
""")
|
||||
reprec = testdir.inline_run("-s")
|
||||
l = reprec.getcalls("pytest_runtest_call")[0].item.module.l
|
||||
assert l == [1,2]
|
||||
assert l == [1, 2]
|
||||
|
||||
def test_parametrize_separated_lifecycle(self, testdir):
|
||||
testdir.makepyfile("""
|
||||
@@ -2544,7 +2544,7 @@ class TestFixtureMarker(object):
|
||||
|
||||
|
||||
class TestRequestScopeAccess(object):
|
||||
pytestmark = pytest.mark.parametrize(("scope", "ok", "error"),[
|
||||
pytestmark = pytest.mark.parametrize(("scope", "ok", "error"), [
|
||||
["session", "", "fspath class function module"],
|
||||
["module", "module fspath", "cls function"],
|
||||
["class", "module fspath cls", "function"],
|
||||
|
||||
@@ -96,12 +96,12 @@ class TestMetafunc(object):
|
||||
def test_parametrize_error(self):
|
||||
def func(x, y): pass
|
||||
metafunc = self.Metafunc(func)
|
||||
metafunc.parametrize("x", [1,2])
|
||||
pytest.raises(ValueError, lambda: metafunc.parametrize("x", [5,6]))
|
||||
pytest.raises(ValueError, lambda: metafunc.parametrize("x", [5,6]))
|
||||
metafunc.parametrize("y", [1,2])
|
||||
pytest.raises(ValueError, lambda: metafunc.parametrize("y", [5,6]))
|
||||
pytest.raises(ValueError, lambda: metafunc.parametrize("y", [5,6]))
|
||||
metafunc.parametrize("x", [1, 2])
|
||||
pytest.raises(ValueError, lambda: metafunc.parametrize("x", [5, 6]))
|
||||
pytest.raises(ValueError, lambda: metafunc.parametrize("x", [5, 6]))
|
||||
metafunc.parametrize("y", [1, 2])
|
||||
pytest.raises(ValueError, lambda: metafunc.parametrize("y", [5, 6]))
|
||||
pytest.raises(ValueError, lambda: metafunc.parametrize("y", [5, 6]))
|
||||
|
||||
def test_parametrize_bad_scope(self, testdir):
|
||||
def func(x): pass
|
||||
@@ -115,7 +115,7 @@ class TestMetafunc(object):
|
||||
def func(x, y): pass
|
||||
metafunc = self.Metafunc(func)
|
||||
|
||||
metafunc.parametrize("x", [1,2], ids=['basic', 'advanced'])
|
||||
metafunc.parametrize("x", [1, 2], ids=['basic', 'advanced'])
|
||||
metafunc.parametrize("y", ["abc", "def"])
|
||||
ids = [x.id for x in metafunc._calls]
|
||||
assert ids == ["basic-abc", "basic-def", "advanced-abc", "advanced-def"]
|
||||
@@ -133,11 +133,11 @@ class TestMetafunc(object):
|
||||
metafunc = self.Metafunc(func)
|
||||
|
||||
pytest.raises(ValueError, lambda:
|
||||
metafunc.parametrize("x", [1,2], ids=['basic']))
|
||||
metafunc.parametrize("x", [1, 2], ids=['basic']))
|
||||
|
||||
pytest.raises(ValueError, lambda:
|
||||
metafunc.parametrize(("x","y"), [("abc", "def"),
|
||||
("ghi", "jkl")], ids=["one"]))
|
||||
metafunc.parametrize(("x", "y"), [("abc", "def"),
|
||||
("ghi", "jkl")], ids=["one"]))
|
||||
|
||||
@pytest.mark.issue510
|
||||
def test_parametrize_empty_list(self):
|
||||
@@ -371,7 +371,7 @@ class TestMetafunc(object):
|
||||
|
||||
def test_idmaker_with_ids_unique_names(self):
|
||||
from _pytest.python import idmaker
|
||||
result = idmaker(("a"), map(pytest.param, [1,2,3,4,5]),
|
||||
result = idmaker(("a"), map(pytest.param, [1, 2, 3, 4, 5]),
|
||||
ids=["a", "a", "b", "c", "b"])
|
||||
assert result == ["a0", "a1", "b0", "c", "b1"]
|
||||
|
||||
@@ -379,7 +379,7 @@ class TestMetafunc(object):
|
||||
def func(x, y): pass
|
||||
metafunc = self.Metafunc(func)
|
||||
metafunc.addcall({'x': 1})
|
||||
metafunc.parametrize('y', [2,3])
|
||||
metafunc.parametrize('y', [2, 3])
|
||||
assert len(metafunc._calls) == 2
|
||||
assert metafunc._calls[0].funcargs == {'x': 1, 'y': 2}
|
||||
assert metafunc._calls[1].funcargs == {'x': 1, 'y': 3}
|
||||
@@ -391,12 +391,12 @@ class TestMetafunc(object):
|
||||
def func(x, y): pass
|
||||
metafunc = self.Metafunc(func)
|
||||
metafunc.parametrize('x', [1], indirect=True)
|
||||
metafunc.parametrize('y', [2,3], indirect=True)
|
||||
metafunc.parametrize('y', [2, 3], indirect=True)
|
||||
assert len(metafunc._calls) == 2
|
||||
assert metafunc._calls[0].funcargs == {}
|
||||
assert metafunc._calls[1].funcargs == {}
|
||||
assert metafunc._calls[0].params == dict(x=1,y=2)
|
||||
assert metafunc._calls[1].params == dict(x=1,y=3)
|
||||
assert metafunc._calls[0].params == dict(x=1, y=2)
|
||||
assert metafunc._calls[1].params == dict(x=1, y=3)
|
||||
|
||||
@pytest.mark.issue714
|
||||
def test_parametrize_indirect_list(self):
|
||||
@@ -554,12 +554,12 @@ class TestMetafunc(object):
|
||||
metafunc = self.Metafunc(func)
|
||||
metafunc.addcall(param="123")
|
||||
metafunc.parametrize('x', [1], indirect=True)
|
||||
metafunc.parametrize('y', [2,3], indirect=True)
|
||||
metafunc.parametrize('y', [2, 3], indirect=True)
|
||||
assert len(metafunc._calls) == 2
|
||||
assert metafunc._calls[0].funcargs == {}
|
||||
assert metafunc._calls[1].funcargs == {}
|
||||
assert metafunc._calls[0].params == dict(x=1,y=2)
|
||||
assert metafunc._calls[1].params == dict(x=1,y=3)
|
||||
assert metafunc._calls[0].params == dict(x=1, y=2)
|
||||
assert metafunc._calls[1].params == dict(x=1, y=3)
|
||||
|
||||
def test_parametrize_functional(self, testdir):
|
||||
testdir.makepyfile("""
|
||||
@@ -584,7 +584,7 @@ class TestMetafunc(object):
|
||||
|
||||
def test_parametrize_onearg(self):
|
||||
metafunc = self.Metafunc(lambda x: None)
|
||||
metafunc.parametrize("x", [1,2])
|
||||
metafunc.parametrize("x", [1, 2])
|
||||
assert len(metafunc._calls) == 2
|
||||
assert metafunc._calls[0].funcargs == dict(x=1)
|
||||
assert metafunc._calls[0].id == "1"
|
||||
@@ -593,15 +593,15 @@ class TestMetafunc(object):
|
||||
|
||||
def test_parametrize_onearg_indirect(self):
|
||||
metafunc = self.Metafunc(lambda x: None)
|
||||
metafunc.parametrize("x", [1,2], indirect=True)
|
||||
metafunc.parametrize("x", [1, 2], indirect=True)
|
||||
assert metafunc._calls[0].params == dict(x=1)
|
||||
assert metafunc._calls[0].id == "1"
|
||||
assert metafunc._calls[1].params == dict(x=2)
|
||||
assert metafunc._calls[1].id == "2"
|
||||
|
||||
def test_parametrize_twoargs(self):
|
||||
metafunc = self.Metafunc(lambda x,y: None)
|
||||
metafunc.parametrize(("x", "y"), [(1,2), (3,4)])
|
||||
metafunc = self.Metafunc(lambda x, y: None)
|
||||
metafunc.parametrize(("x", "y"), [(1, 2), (3, 4)])
|
||||
assert len(metafunc._calls) == 2
|
||||
assert metafunc._calls[0].funcargs == dict(x=1, y=2)
|
||||
assert metafunc._calls[0].id == "1-2"
|
||||
|
||||
Reference in New Issue
Block a user