Always used the library packaged mock

The library packaged mock seems to work
better across python versions, so instead of
trying to mix the system one and the library
one always prefer the library one (which should
work in all supported python versions).

Change-Id: Id6ada69df9961a6b7511316e2f75ef9ee5f0b72b
This commit is contained in:
Joshua Harlow 2016-05-10 10:48:23 -07:00
parent fd2dc3da7e
commit 3321b22ca8
1 changed files with 1 additions and 13 deletions

View File

@ -20,23 +20,11 @@ import collections
import logging
import fixtures
import mock
from oslotest import base
from oslotest import mockpatch
import six
# This is weird like this since we want to import a mock that works the best
# and we need to try this import order, since oslotest registers a six.moves
# module (but depending on the import order of importing oslotest we may or
# may not see that change when trying to use it from six).
try:
from six.moves import mock
except ImportError:
try:
# In python 3.3+ mock got included in the standard library...
from unittest import mock
except ImportError:
import mock
from testtools import compat
from testtools import matchers
from testtools import testcase