From 46deca788bf06b1472f2da89bbf38642ae78324f Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Mon, 13 Oct 2014 10:31:16 -0400 Subject: [PATCH] Fix F812 PEP8 error One file was redefining a variable, thus exposing this PEP8 error: F812 list comprehension redefines 'n' from line 1868 This fixes it and enables the check in tox.ini. Change-Id: Ifa9a2365160db1b8ec80b274f3458cea6bd1f653 --- ironic/tests/conductor/test_manager.py | 10 +++++----- tox.ini | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ironic/tests/conductor/test_manager.py b/ironic/tests/conductor/test_manager.py index ba9bbaf85f..9adde98631 100644 --- a/ironic/tests/conductor/test_manager.py +++ b/ironic/tests/conductor/test_manager.py @@ -1899,14 +1899,14 @@ class ManagerSyncPowerStatesTestCase(_CommonMixIn, tests_db_base.DbTestCase): get_nodeinfo_mock.assert_called_once_with( columns=self.columns, filters=self.filters) - mapped_calls = [mock.call(n.uuid, n.driver) for n in nodes] + mapped_calls = [mock.call(x.uuid, x.driver) for x in nodes] self.assertEqual(mapped_calls, mapped_mock.call_args_list) - get_node_calls = [mock.call(self.context, n.id) - for n in nodes[:1] + nodes[2:]] + get_node_calls = [mock.call(self.context, x.id) + for x in nodes[:1] + nodes[2:]] self.assertEqual(get_node_calls, get_node_mock.call_args_list) - acquire_calls = [mock.call(self.context, n.id) - for n in nodes[:1] + nodes[6:]] + acquire_calls = [mock.call(self.context, x.id) + for x in nodes[:1] + nodes[6:]] self.assertEqual(acquire_calls, acquire_mock.call_args_list) sync_calls = [mock.call(tasks[0]), mock.call(tasks[5])] self.assertEqual(sync_calls, sync_mock.call_args_list) diff --git a/tox.ini b/tox.ini index 2c7e2df291..cad52859c9 100644 --- a/tox.ini +++ b/tox.ini @@ -47,7 +47,7 @@ commands = {posargs} [flake8] # E711: ignored because it is normal to use "column == None" in sqlalchemy # TODO(yuriyz): Analyze or fix the warnings blacklisted below -ignore = E12,E111,E113,E131,E265,E711,F812 +ignore = E12,E111,E113,E131,E265,E711 exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,*ironic/nova* [hacking]