diff options
Diffstat (limited to 'tests/test_wrapper.py')
-rw-r--r-- | tests/test_wrapper.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index 5e2cfa57..d8713738 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py | |||
@@ -15,27 +15,20 @@ | |||
15 | """Unittests for the wrapper.py module.""" | 15 | """Unittests for the wrapper.py module.""" |
16 | 16 | ||
17 | import contextlib | 17 | import contextlib |
18 | from io import StringIO | ||
18 | import os | 19 | import os |
19 | import re | 20 | import re |
20 | import shutil | 21 | import shutil |
21 | import tempfile | 22 | import tempfile |
22 | import unittest | 23 | import unittest |
24 | from unittest import mock | ||
23 | 25 | ||
24 | import git_command | 26 | import git_command |
25 | import main | 27 | import main |
26 | import platform_utils | 28 | import platform_utils |
27 | from pyversion import is_python3 | ||
28 | import wrapper | 29 | import wrapper |
29 | 30 | ||
30 | 31 | ||
31 | if is_python3(): | ||
32 | from unittest import mock | ||
33 | from io import StringIO | ||
34 | else: | ||
35 | import mock | ||
36 | from StringIO import StringIO | ||
37 | |||
38 | |||
39 | @contextlib.contextmanager | 32 | @contextlib.contextmanager |
40 | def TemporaryDirectory(): | 33 | def TemporaryDirectory(): |
41 | """Create a new empty git checkout for testing.""" | 34 | """Create a new empty git checkout for testing.""" |
@@ -62,9 +55,6 @@ class RepoWrapperTestCase(unittest.TestCase): | |||
62 | wrapper._wrapper_module = None | 55 | wrapper._wrapper_module = None |
63 | self.wrapper = wrapper.Wrapper() | 56 | self.wrapper = wrapper.Wrapper() |
64 | 57 | ||
65 | if not is_python3(): | ||
66 | self.assertRegex = self.assertRegexpMatches | ||
67 | |||
68 | 58 | ||
69 | class RepoWrapperUnitTest(RepoWrapperTestCase): | 59 | class RepoWrapperUnitTest(RepoWrapperTestCase): |
70 | """Tests helper functions in the repo wrapper | 60 | """Tests helper functions in the repo wrapper |