summaryrefslogtreecommitdiff
path: root/tests/compat.py
diff options
context:
space:
mode:
authorChris Lasher <chris.lasher@gmail.com>2013-01-18 14:36:18 -0500
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-03-04 23:26:31 +0100
commit3c011a3c6e97e40410ad88a734605759fb247301 (patch)
treed86a52ec2f92294ccb59a0e39bc34b96fd8e557c /tests/compat.py
parentbe403fd5a109af49d228ab620ab14d04cb9e34c8 (diff)
downloadfactory-boy-3c011a3c6e97e40410ad88a734605759fb247301.tar
factory-boy-3c011a3c6e97e40410ad88a734605759fb247301.tar.gz
Let mock source be chosen by Python major version.
This should provide better Python 3 compatibility, since mock is in the Python 3 standard library as unittest.mock. Conflicts: tests/test_declarations.py Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'tests/compat.py')
-rw-r--r--tests/compat.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/compat.py b/tests/compat.py
index 8d4f1d0..769ffd4 100644
--- a/tests/compat.py
+++ b/tests/compat.py
@@ -29,3 +29,9 @@ try:
import unittest2 as unittest
except ImportError:
import unittest
+
+if is_python2:
+ import mock
+else:
+ from unittest import mock
+