Fixed E712 flake8 errors
comparison to True should be ‘if cond is True:’ or ‘if cond:’
This commit is contained in:
parent
5ae59279f4
commit
15610289ac
|
@ -872,7 +872,7 @@ def fixture(scope="function", params=None, autouse=False, ids=None, name=None):
|
||||||
instead of ``return``. In this case, the code block after the ``yield`` statement is executed
|
instead of ``return``. In this case, the code block after the ``yield`` statement is executed
|
||||||
as teardown code regardless of the test outcome. A fixture function must yield exactly once.
|
as teardown code regardless of the test outcome. A fixture function must yield exactly once.
|
||||||
"""
|
"""
|
||||||
if callable(scope) and params is None and autouse == False:
|
if callable(scope) and params is None and autouse is False:
|
||||||
# direct decoration
|
# direct decoration
|
||||||
return FixtureFunctionMarker(
|
return FixtureFunctionMarker(
|
||||||
"function", params, autouse, name=name)(scope)
|
"function", params, autouse, name=name)(scope)
|
||||||
|
|
|
@ -164,12 +164,12 @@ class TestParser(object):
|
||||||
assert getattr(args, parseopt.FILE_OR_DIR) == ['4', '2']
|
assert getattr(args, parseopt.FILE_OR_DIR) == ['4', '2']
|
||||||
args = parser.parse(['-R', '-S', '4', '2', '-R'])
|
args = parser.parse(['-R', '-S', '4', '2', '-R'])
|
||||||
assert getattr(args, parseopt.FILE_OR_DIR) == ['4', '2']
|
assert getattr(args, parseopt.FILE_OR_DIR) == ['4', '2']
|
||||||
assert args.R == True
|
assert args.R is True
|
||||||
assert args.S == False
|
assert args.S is False
|
||||||
args = parser.parse(['-R', '4', '-S', '2'])
|
args = parser.parse(['-R', '4', '-S', '2'])
|
||||||
assert getattr(args, parseopt.FILE_OR_DIR) == ['4', '2']
|
assert getattr(args, parseopt.FILE_OR_DIR) == ['4', '2']
|
||||||
assert args.R == True
|
assert args.R is True
|
||||||
assert args.S == False
|
assert args.S is False
|
||||||
|
|
||||||
def test_parse_defaultgetter(self):
|
def test_parse_defaultgetter(self):
|
||||||
def defaultget(option):
|
def defaultget(option):
|
||||||
|
|
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 = E712,E731
|
ignore = 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