From 3321b22ca81bd0e1d8923abc62db014d07fed9ce Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 10 May 2016 10:48:23 -0700 Subject: [PATCH] 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 --- taskflow/test.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/taskflow/test.py b/taskflow/test.py index bf252229..1d2676a3 100644 --- a/taskflow/test.py +++ b/taskflow/test.py @@ -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