diff --git a/keystone/tests/unit/identity/test_core.py b/keystone/tests/unit/identity/test_core.py index f69b367df9..fc006054c1 100644 --- a/keystone/tests/unit/identity/test_core.py +++ b/keystone/tests/unit/identity/test_core.py @@ -105,8 +105,8 @@ class TestDomainConfigs(unit.BaseTestCase): name, identity.DOMAIN_CONF_FTAIL))) - walk_fake = lambda *a, **kwa: ( - ('/fake/keystone/domains/config', [], files), ) + def walk_fake(*a, **kwa): + return ('/fake/keystone/domains/config', [], files), generic_driver = mock.Mock(is_sql=False) diff --git a/keystone/tests/unit/test_backend_templated.py b/keystone/tests/unit/test_backend_templated.py index 01c7e36cb3..096d5cb029 100644 --- a/keystone/tests/unit/test_backend_templated.py +++ b/keystone/tests/unit/test_backend_templated.py @@ -88,7 +88,8 @@ class TestTemplatedCatalog(unit.TestCase, catalog_tests.CatalogTests): "Templated backend doesn't have disabled endpoints") def assert_catalogs_equal(self, expected, observed): - sort_key = lambda d: d['id'] + def sort_key(d): + return d['id'] for e, o in zip(sorted(expected, key=sort_key), sorted(observed, key=sort_key)): expected_endpoints = e.pop('endpoints') diff --git a/tools/fast8.sh b/tools/fast8.sh index 97ab09f19b..dbe8536662 100755 --- a/tools/fast8.sh +++ b/tools/fast8.sh @@ -22,4 +22,4 @@ for FILE in $CHANGED; do fi done -diff -u --from-file /dev/null $CHECK | flake8 --diff --ignore=D100,D101,D102,D103,D104,E305,E402,E501,W503,W504,W605,E731 +diff -u --from-file /dev/null $CHECK | flake8 --diff --ignore=D100,D101,D102,D103,D104,E305,E402,E501,W503,W504,W605 diff --git a/tox.ini b/tox.ini index 2becb181cc..bf92e32421 100644 --- a/tox.ini +++ b/tox.ini @@ -32,7 +32,7 @@ deps = .[bandit] {[testenv]deps} commands = - flake8 --ignore=D100,D101,D102,D103,D104,E305,E402,E501,W503,W504,W605,E731 + flake8 --ignore=D100,D101,D102,D103,D104,E305,E402,E501,W503,W504,W605 # Run bash8 during pep8 runs to ensure violations are caught by # the check and gate queues bashate devstack/plugin.sh @@ -127,8 +127,7 @@ enable-extensions = H203,H904 # TODO(wxy): Fix the pep8 issue. # E402: module level import not at top of file # W503: line break before binary operator -# E731: do not assign a lambda expression, use a def -ignore = D100,D101,D102,D103,D104,D203,E402,W503,E731 +ignore = D100,D101,D102,D103,D104,D203,E402,W503 exclude=.venv,.git,.tox,build,dist,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot max-complexity=24