summaryrefslogtreecommitdiff
path: root/tests/compat.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compat.py')
-rw-r--r--tests/compat.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/compat.py b/tests/compat.py
index 15fa3ae..6a1eb80 100644
--- a/tests/compat.py
+++ b/tests/compat.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2011 Raphaël Barrois
+# Copyright (c) 2011-2013 Raphaël Barrois
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -21,7 +21,17 @@
"""Compatibility tools for tests"""
+import sys
+
+is_python2 = (sys.version_info[0] == 2)
+
try:
import unittest2 as unittest
except ImportError:
import unittest
+
+if sys.version_info[0:2] < (3, 3):
+ import mock
+else:
+ from unittest import mock
+