diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2016-01-20 15:17:34 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2016-01-22 01:07:32 +0100 |
commit | 812dc9be341b69394502e3a7422fb6a3d3ce1423 (patch) | |
tree | 69d1422f09807889ffa450db7f2e604a189f7937 /testsuite/common.py | |
parent | 2d2a3905ca48622e0e974176e0a5bbd739c7c8fa (diff) | |
download | bcfg2-812dc9be341b69394502e3a7422fb6a3d3ce1423.tar.gz bcfg2-812dc9be341b69394502e3a7422fb6a3d3ce1423.tar.bz2 bcfg2-812dc9be341b69394502e3a7422fb6a3d3ce1423.zip |
testsuite: Newer version of mock require different imports
Be flexible and support the imports required by newer versions of the mock
package (>1.1.0). Because this new version is not available on all distributions
we are flexible and also support the old style.
Diffstat (limited to 'testsuite/common.py')
-rw-r--r-- | testsuite/common.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/testsuite/common.py b/testsuite/common.py index 9f51cc14f..396f1887b 100644 --- a/testsuite/common.py +++ b/testsuite/common.py @@ -15,7 +15,10 @@ import codecs import lxml.etree import Bcfg2.Options import Bcfg2.Utils -from mock import patch, MagicMock, _patch, DEFAULT +try: + from mock.mock import patch, MagicMock, _patch, DEFAULT +except ImportError: + from mock import patch, MagicMock, _patch, DEFAULT try: from unittest2 import skip, skipIf, skipUnless, TestCase except ImportError: |