Fixing flake8 warnings and errors

flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude benchmark

Excluding the benchmark directory (due to protobuf generated files)
Also removing some Python2 specific code
This commit is contained in:
Jacob Alexander
2019-09-26 22:18:28 -07:00
parent 1f0200af9c
commit b3021e4f6b
37 changed files with 536 additions and 452 deletions

View File

@@ -7,15 +7,15 @@ this_dir = os.path.dirname(__file__)
@pytest.fixture
def addressbook():
return capnp.load(os.path.join(this_dir, 'addressbook.capnp'))
return capnp.load(os.path.join(this_dir, 'addressbook.capnp'))
@pytest.fixture
def foo():
return capnp.load(os.path.join(this_dir, 'foo.capnp'))
return capnp.load(os.path.join(this_dir, 'foo.capnp'))
@pytest.fixture
def bar():
return capnp.load(os.path.join(this_dir, 'bar.capnp'))
return capnp.load(os.path.join(this_dir, 'bar.capnp'))
def test_basic_load():
capnp.load(os.path.join(this_dir, 'addressbook.capnp'))
@@ -56,13 +56,13 @@ def test_failed_import():
bar.foo = foo
def test_defualt_import_hook():
import addressbook_capnp
import addressbook_capnp # noqa: F401
def test_dash_import():
import addressbook_with_dashes_capnp
import addressbook_with_dashes_capnp # noqa: F401
def test_spaces_import():
import addressbook_with_spaces_capnp
import addressbook_with_spaces_capnp # noqa: F401
def test_add_import_hook():
capnp.add_import_hook([this_dir])
@@ -86,4 +86,4 @@ def test_remove_import_hook():
del sys.modules['addressbook_capnp'] # hack to deal with it being imported already
with pytest.raises(ImportError):
import addressbook_capnp
import addressbook_capnp # noqa: F401