Skip to content

Commit

Permalink
Reduces the amount of mocked imports for Python 3
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dstanek committed Jul 22, 2014
1 parent c770a35 commit 03d7e66
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions keystone/tests/__init__.py
Expand Up @@ -25,16 +25,10 @@
import sys
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.green'] = 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['paste'] = mock.Mock()

Expand Down

0 comments on commit 03d7e66

Please sign in to comment.