Import mock from unittest if on py3
authorChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 16 Sep 2014 19:26:40 +0000 (14:26 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Tue, 16 Sep 2014 19:26:40 +0000 (14:26 -0500)
mediagoblin/tests/test_api.py

index 329c387de3ad7d4742a30b7a94887fa6e84abfae..31bf50b3ffabc536d18a904fbada2cdd18483b3c 100644 (file)
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import json
 
-import mock
+try:
+    import mock
+except ImportError:
+    import unittest.mock as mock
 import pytest
 
 from webtest import AppError