[PR #5978/9f87989e backport][stable-6] Remove unnecessary test imports (#5979)

Remove unnecessary test imports (#5978)

Remove unnecessary test imports.

(cherry picked from commit 9f87989e7f)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot]
2023-02-12 21:36:32 +01:00
committed by GitHub
parent 554ec94110
commit 3d70bfa1e4
71 changed files with 70 additions and 121 deletions

View File

@@ -13,7 +13,7 @@ __metaclass__ = type
# One unittest needs to import builtins via __import__() so we need to have
# the string that represents it
try:
import __builtin__
import __builtin__ # noqa: F401, pylint: disable=unused-import
except ImportError:
BUILTINS = 'builtins'
else:

View File

@@ -20,12 +20,12 @@ try:
# Allow wildcard import because we really do want to import all of mock's
# symbols into this compat shim
# pylint: disable=wildcard-import,unused-wildcard-import
from unittest.mock import *
from unittest.mock import * # noqa: F401, pylint: disable=unused-import
except ImportError:
# Python 2
# pylint: disable=wildcard-import,unused-wildcard-import
try:
from mock import *
from mock import * # noqa: F401, pylint: disable=unused-import
except ImportError:
print('You need the mock library installed on python2.x to run tests')

View File

@@ -18,8 +18,8 @@ import sys
if sys.version_info < (2, 7):
try:
# Need unittest2 on python2.6
from unittest2 import *
from unittest2 import * # noqa: F401, pylint: disable=unused-import
except ImportError:
print('You need unittest2 installed on python2.6.x to run tests')
else:
from unittest import *
from unittest import * # noqa: F401, pylint: disable=unused-import