Reduces the amount of mocked imports for Python 3
The evolution of the code as well as the Python 3 fixes has made some of the module mocking unnecessary. bp python3 Change-Id: I57e535012d89ee307acd43724dd678263704596f
This commit is contained in:
parent
c770a3505f
commit
03d7e662af
@ -25,16 +25,10 @@ if six.PY3:
|
|||||||
import sys
|
import sys
|
||||||
from unittest import mock # noqa: our import detection is naive?
|
from unittest import mock # noqa: our import detection is naive?
|
||||||
|
|
||||||
# NOTE(dstanek): oslo.config is imported there so that later module
|
|
||||||
# that use it will still have access. If we don't import it now then
|
|
||||||
# it won't be available because of how I am patching oslo below.
|
|
||||||
import oslo.config # noqa: need this imported before the monkey patching
|
|
||||||
import oslo.db # noqa: need this imported before the monkey patching
|
|
||||||
sys.modules['eventlet'] = mock.Mock()
|
sys.modules['eventlet'] = mock.Mock()
|
||||||
sys.modules['eventlet.green'] = mock.Mock()
|
sys.modules['eventlet.green'] = mock.Mock()
|
||||||
sys.modules['eventlet.wsgi'] = mock.Mock()
|
sys.modules['eventlet.wsgi'] = mock.Mock()
|
||||||
sys.modules['oslo'] = mock.Mock()
|
sys.modules['oslo'].messaging = mock.Mock()
|
||||||
sys.modules['oslo.messaging'] = mock.Mock()
|
|
||||||
sys.modules['pycadf'] = mock.Mock()
|
sys.modules['pycadf'] = mock.Mock()
|
||||||
sys.modules['paste'] = mock.Mock()
|
sys.modules['paste'] = mock.Mock()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user