Just "import mock" as it works for Python 2 and 3
Don't try to special case "import mock" depending if Python 3 vs Python 2. It works to just use "import mock" no matter which version. Change-Id: I35c67cb86559c0557a757c6a7664c3f56961dfe5
This commit is contained in:
parent
4cecee4bbb
commit
660b682764
@ -14,10 +14,7 @@
|
||||
|
||||
# Mostly copied from ironic/tests/test_swift.py
|
||||
|
||||
try:
|
||||
from unittest import mock
|
||||
except ImportError:
|
||||
import mock
|
||||
import mock
|
||||
from swiftclient import client as swift_client
|
||||
from swiftclient import exceptions as swift_exception
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
from keystonemiddleware import auth_token
|
||||
import mock
|
||||
from oslo_config import cfg
|
||||
|
||||
from ironic_inspector import node_cache
|
||||
@ -19,11 +20,6 @@ from ironic_inspector.test import base
|
||||
from ironic_inspector import utils
|
||||
from ironicclient.v1 import node
|
||||
|
||||
try:
|
||||
from unittest import mock
|
||||
except ImportError:
|
||||
import mock
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user