Browse Source

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
changes/39/75839/18
Alexander Bochkarev 8 years ago
committed by Gerrit Code Review
parent
commit
c83511afb3
  1. 2
      cinder/db/__init__.py
  2. 17
      cinder/tests/api/__init__.py
  3. 17
      cinder/tests/api/contrib/__init__.py
  4. 17
      cinder/tests/api/openstack/__init__.py
  5. 18
      cinder/tests/image/__init__.py
  6. 20
      cinder/tests/integrated/__init__.py
  7. 17
      cinder/tests/scheduler/__init__.py
  8. 2
      tox.ini

2
cinder/db/__init__.py

@ -17,4 +17,4 @@
DB abstraction for Cinder
"""
from cinder.db.api import *
from cinder.db.api import * # noqa

17
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 *

17
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 *

17
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 *

18
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 *

20
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 *

17
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 *

2
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
Loading…
Cancel
Save