From 40bed1ea88e1b0e2cddc380f24823390f6e3bba3 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Tue, 7 Apr 2020 15:38:20 +0200 Subject: [PATCH] Make flake8 tests more strict Also increasing min version of flake8-import-order for some bug fixes. Change-Id: I6cca85a87e2946998bb2e912aa44bd3d709562c4 --- .../tests/unit/iboot/test_power.py | 2 +- .../tests/unit/libvirt/test_power.py | 4 +--- lower-constraints.txt | 2 +- test-requirements.txt | 2 +- tox.ini | 13 +++---------- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/ironic_staging_drivers/tests/unit/iboot/test_power.py b/ironic_staging_drivers/tests/unit/iboot/test_power.py index 7cf2023..352e38e 100644 --- a/ironic_staging_drivers/tests/unit/iboot/test_power.py +++ b/ironic_staging_drivers/tests/unit/iboot/test_power.py @@ -17,7 +17,6 @@ import types -import mock from ironic.common import exception as ironic_exception from ironic.common import states @@ -25,6 +24,7 @@ from ironic.conductor import task_manager from ironic.drivers.modules import fake from ironic.tests.unit.db import base as db_base from ironic.tests.unit.objects import utils as obj_utils +import mock from ironic_staging_drivers.iboot import power as iboot_power diff --git a/ironic_staging_drivers/tests/unit/libvirt/test_power.py b/ironic_staging_drivers/tests/unit/libvirt/test_power.py index dee16aa..67d7a77 100644 --- a/ironic_staging_drivers/tests/unit/libvirt/test_power.py +++ b/ironic_staging_drivers/tests/unit/libvirt/test_power.py @@ -15,11 +15,8 @@ """Test class for Ironic libvirt driver.""" - import tempfile -import mock - from ironic.common import boot_devices from ironic.common import exception from ironic.common import states @@ -27,6 +24,7 @@ from ironic.conductor import task_manager from ironic.drivers import utils as driver_utils from ironic.tests.unit.db import base as db_base from ironic.tests.unit.objects import utils as obj_utils +import mock from ironic_staging_drivers.common import exception as isd_exc from ironic_staging_drivers.libvirt import power diff --git a/lower-constraints.txt b/lower-constraints.txt index 1fc65ac..fef4a3c 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -15,7 +15,7 @@ eventlet==0.20.0 extras==1.0.0 fasteners==0.14.1 fixtures==3.0.0 -flake8-import-order==0.11 +flake8-import-order==0.13 flake8==2.5.5 future==0.16.0 greenlet==0.4.13 diff --git a/test-requirements.txt b/test-requirements.txt index 8066563..0aa1b95 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,7 @@ # process, which may cause wedges in the gate later. hacking>=3.0.0,<3.1.0 # Apache-2.0 -flake8-import-order==0.11 # LGPLv3 +flake8-import-order>=0.13 # LGPLv3 coverage!=4.4,>=4.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 3c9f936..ecc182e 100644 --- a/tox.ini +++ b/tox.ini @@ -51,17 +51,10 @@ commands = oslo_debug_helper {posargs} commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [flake8] -# [E129] visually indented line with same indent as next logical line -# [W503] Line break before binary operator. -ignore = E129,W503 -exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build -import-order-style = pep8 application-import-names = ironic_staging_drivers -max-complexity=17 -# [H106] Don't put vim configuration in source files. -# [H203] Use assertIs(Not)None to check for None. -# [H904] Delay string interpolations at logging calls. -enable-extensions=H106,H203,H904 +exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build +import-order-style = pep8 +show-source = True [testenv:lower-constraints] deps =