Fixed E101 flake8 errors

indentation contains mixed spaces and tabs
This commit is contained in:
Andras Tim 2017-07-17 01:25:06 +02:00
parent 6af2abdb53
commit 6146ac97d9
9 changed files with 17 additions and 17 deletions

View File

@ -332,7 +332,7 @@ def _fix_spoof_python2(runner, encoding):
should patch only doctests for text files because they don't have a way to declare their should patch only doctests for text files because they don't have a way to declare their
encoding. Doctests in docstrings from Python modules don't have the same problem given that encoding. Doctests in docstrings from Python modules don't have the same problem given that
Python already decoded the strings. Python already decoded the strings.
This fixes the problem related in issue #2434. This fixes the problem related in issue #2434.
""" """
from _pytest.compat import _PY2 from _pytest.compat import _PY2

View File

@ -1032,11 +1032,11 @@ class Testdir:
return child return child
def getdecoded(out): def getdecoded(out):
try: try:
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:

View File

@ -151,7 +151,7 @@ def pytest_collect_file(path, parent):
if path.fnmatch(pat): if path.fnmatch(pat):
break break
else: else:
return return
ihook = parent.session.gethookproxy(path) ihook = parent.session.gethookproxy(path)
return ihook.pytest_pycollect_makemodule(path=path, parent=parent) return ihook.pytest_pycollect_makemodule(path=path, parent=parent)

View File

@ -319,25 +319,25 @@ class TestConftestVisibility(object):
# N.B.: "swc" stands for "subdir with conftest.py" # N.B.: "swc" stands for "subdir with conftest.py"
# "snc" stands for "subdir no [i.e. without] conftest.py" # "snc" stands for "subdir no [i.e. without] conftest.py"
@pytest.mark.parametrize("chdir,testarg,expect_ntests_passed", [ @pytest.mark.parametrize("chdir,testarg,expect_ntests_passed", [
# Effective target: package/.. # Effective target: package/..
("runner", "..", 3), ("runner", "..", 3),
("package", "..", 3), ("package", "..", 3),
("swc", "../..", 3), ("swc", "../..", 3),
("snc", "../..", 3), ("snc", "../..", 3),
# Effective target: package # Effective target: package
("runner", "../package", 3), ("runner", "../package", 3),
("package", ".", 3), ("package", ".", 3),
("swc", "..", 3), ("swc", "..", 3),
("snc", "..", 3), ("snc", "..", 3),
# Effective target: package/swc # Effective target: package/swc
("runner", "../package/swc", 1), ("runner", "../package/swc", 1),
("package", "./swc", 1), ("package", "./swc", 1),
("swc", ".", 1), ("swc", ".", 1),
("snc", "../swc", 1), ("snc", "../swc", 1),
# Effective target: package/snc # Effective target: package/snc
("runner", "../package/snc", 1), ("runner", "../package/snc", 1),
("package", "./snc", 1), ("package", "./snc", 1),
("swc", "../snc", 1), ("swc", "../snc", 1),

View File

@ -535,7 +535,7 @@ class TestDoctests(object):
p = testdir.makepyfile(test_unicode_doctest_module=""" p = testdir.makepyfile(test_unicode_doctest_module="""
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
def fix_bad_unicode(text): def fix_bad_unicode(text):
''' '''
>>> print(fix_bad_unicode('único')) >>> print(fix_bad_unicode('único'))

View File

@ -323,6 +323,6 @@ def test_issue1338_name_resolving():
pytest.importorskip('requests') pytest.importorskip('requests')
monkeypatch = MonkeyPatch() monkeypatch = MonkeyPatch()
try: try:
monkeypatch.delattr('requests.sessions.Session.request') monkeypatch.delattr('requests.sessions.Session.request')
finally: finally:
monkeypatch.undo() monkeypatch.undo()

View File

@ -788,7 +788,7 @@ def test_unittest_raise_skip_issue748(testdir):
def test_unittest_skip_issue1169(testdir): def test_unittest_skip_issue1169(testdir):
testdir.makepyfile(test_foo=""" testdir.makepyfile(test_foo="""
import unittest import unittest
class MyTestCase(unittest.TestCase): class MyTestCase(unittest.TestCase):
@unittest.skip("skipping due to reasons") @unittest.skip("skipping due to reasons")
def test_skip(self): def test_skip(self):

View File

@ -173,9 +173,9 @@ def test_works_with_filterwarnings(testdir):
class MyWarning(Warning): class MyWarning(Warning):
pass pass
warnings.filterwarnings("error", category=MyWarning) warnings.filterwarnings("error", category=MyWarning)
class TestWarnings(object): class TestWarnings(object):
def test_my_warning(self): def test_my_warning(self):
try: try:

View File

@ -196,6 +196,6 @@ filterwarnings =
ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning ignore:.*inspect.getargspec.*deprecated, use inspect.signature.*:DeprecationWarning
[flake8] [flake8]
ignore = E101,E111,E113,E121,E122,E123,E124,E125,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 = E111,E113,E121,E122,E123,E124,E125,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
max-line-length = 120 max-line-length = 120
exclude = _pytest/vendored_packages/pluggy.py exclude = _pytest/vendored_packages/pluggy.py