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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user