From c83511afb3fecd9be1438292893f904ca718a151 Mon Sep 17 00:00:00 2001 From: Alexander Bochkarev Date: Mon, 24 Feb 2014 15:10:44 +0400 Subject: [PATCH] Enable flake8 H303,H304 checking We had two types of wildcard imports in the code. Unneeded ones in test files that are just removed, and some that we actually want which are kept using the '#noqa' comment to tell flake8 to skip specific checks (such as H303) for that line. Change-Id: I7d194a7bbcccdba419a2a49a919e17c047633cf0 --- cinder/db/__init__.py | 2 +- cinder/tests/api/__init__.py | 17 ----------------- cinder/tests/api/contrib/__init__.py | 17 ----------------- cinder/tests/api/openstack/__init__.py | 17 ----------------- cinder/tests/image/__init__.py | 18 ------------------ cinder/tests/integrated/__init__.py | 20 -------------------- cinder/tests/scheduler/__init__.py | 17 ----------------- tox.ini | 2 +- 8 files changed, 2 insertions(+), 108 deletions(-) diff --git a/cinder/db/__init__.py b/cinder/db/__init__.py index e59bc4f3fc4..0fa3ac6bbff 100644 --- a/cinder/db/__init__.py +++ b/cinder/db/__init__.py @@ -17,4 +17,4 @@ DB abstraction for Cinder """ -from cinder.db.api import * +from cinder.db.api import * # noqa diff --git a/cinder/tests/api/__init__.py b/cinder/tests/api/__init__.py index a2c6e2e27d1..e69de29bb2d 100644 --- a/cinder/tests/api/__init__.py +++ b/cinder/tests/api/__init__.py @@ -1,17 +0,0 @@ -# Copyright 2011 OpenStack Foundation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# NOTE(vish): this forces the fixtures from tests/__init.py:setup() to work -from cinder.tests import * diff --git a/cinder/tests/api/contrib/__init__.py b/cinder/tests/api/contrib/__init__.py index a2c6e2e27d1..e69de29bb2d 100644 --- a/cinder/tests/api/contrib/__init__.py +++ b/cinder/tests/api/contrib/__init__.py @@ -1,17 +0,0 @@ -# Copyright 2011 OpenStack Foundation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# NOTE(vish): this forces the fixtures from tests/__init.py:setup() to work -from cinder.tests import * diff --git a/cinder/tests/api/openstack/__init__.py b/cinder/tests/api/openstack/__init__.py index a2c6e2e27d1..e69de29bb2d 100644 --- a/cinder/tests/api/openstack/__init__.py +++ b/cinder/tests/api/openstack/__init__.py @@ -1,17 +0,0 @@ -# Copyright 2011 OpenStack Foundation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# NOTE(vish): this forces the fixtures from tests/__init.py:setup() to work -from cinder.tests import * diff --git a/cinder/tests/image/__init__.py b/cinder/tests/image/__init__.py index 9713c65adde..e69de29bb2d 100644 --- a/cinder/tests/image/__init__.py +++ b/cinder/tests/image/__init__.py @@ -1,18 +0,0 @@ -# Copyright 2011 OpenStack Foundation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# NOTE(vish): this forces the fixtures from tests/__init.py:setup() to work - -from cinder.tests import * diff --git a/cinder/tests/integrated/__init__.py b/cinder/tests/integrated/__init__.py index 1870fd0a8fb..e69de29bb2d 100644 --- a/cinder/tests/integrated/__init__.py +++ b/cinder/tests/integrated/__init__.py @@ -1,20 +0,0 @@ -# Copyright (c) 2011 Justin Santa Barbara -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -""" -:mod:`integrated` -- Tests whole systems, using mock services where needed -================================= -""" -# NOTE(vish): this forces the fixtures from tests/__init.py:setup() to work -from cinder.tests import * diff --git a/cinder/tests/scheduler/__init__.py b/cinder/tests/scheduler/__init__.py index a2c6e2e27d1..e69de29bb2d 100644 --- a/cinder/tests/scheduler/__init__.py +++ b/cinder/tests/scheduler/__init__.py @@ -1,17 +0,0 @@ -# Copyright 2011 OpenStack Foundation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# NOTE(vish): this forces the fixtures from tests/__init.py:setup() to work -from cinder.tests import * diff --git a/tox.ini b/tox.ini index 523458057a9..3b0577fd75e 100644 --- a/tox.ini +++ b/tox.ini @@ -43,6 +43,6 @@ commands = commands = {posargs} [flake8] -ignore = E711,E712,F403,H302,H303,H304,H803 +ignore = E711,E712,F403,H302,H803 builtins = _ exclude = .git,.venv,.tox,dist,tools,doc,common,*egg,build