summaryrefslogtreecommitdiff
path: root/tests/testsentinel.py
diff options
context:
space:
mode:
authorfuzzyman <devnull@localhost>2010-06-11 22:15:01 +0000
committerfuzzyman <devnull@localhost>2010-06-11 22:15:01 +0000
commita55c2debc8e5f390f509b1883d01046f5b6087a4 (patch)
tree5bb3846aece5b95701edcf4fa4aaa1c65e649a57 /tests/testsentinel.py
parent3264171754ba5d980b20c7a8cd5878a90dfa49af (diff)
downloadmock-a55c2debc8e5f390f509b1883d01046f5b6087a4.tar.gz
First steps towards Python 3 compatibility.
Diffstat (limited to 'tests/testsentinel.py')
-rw-r--r--tests/testsentinel.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/testsentinel.py b/tests/testsentinel.py
index 6086bbd..90bedfc 100644
--- a/tests/testsentinel.py
+++ b/tests/testsentinel.py
@@ -5,7 +5,12 @@
import os
import sys
-import unittest2
+info = sys.version_info
+if info[:3] >= (3, 2, 0) or info[0] == 2 and info[1] >= 7:
+ # for Python 2.7 and 3.2 ordinary unittest is fine
+ import unittest as unittest2
+else:
+ import unittest2
this_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if not this_dir in sys.path: