Re-add python2 support for a last python2 compatible release
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Tue, 03 Dec 2019 14:51:27 +0100
changeset 581 29125bda3eaa
parent 580 91b90f8ed0ab
child 582 316a24ffcbb7
Re-add python2 support for a last python2 compatible release Some py2 tests fails but looks unrelated.
nazca/utils/dataio.py
test/test_minhashing.py
tox.ini
--- a/nazca/utils/dataio.py	Tue Dec 03 14:46:43 2019 +0100
+++ b/nazca/utils/dataio.py	Tue Dec 03 14:51:27 2019 +0100
@@ -24,7 +24,7 @@
 from six import binary_type, string_types, iteritems
 from six.moves import xrange
 from six.moves.urllib.request import urlopen
-import urllib.parse
+import six.moves.urllib as urllib
 
 from lxml import etree
 
--- a/test/test_minhashing.py	Tue Dec 03 14:46:43 2019 +0100
+++ b/test/test_minhashing.py	Tue Dec 03 14:51:27 2019 +0100
@@ -24,7 +24,7 @@
 from functools import partial
 from os import path
 import random
-from unittest.mock import patch
+from mock import patch
 
 from nazca.utils.normalize import simplify
 from nazca.utils.minhashing import Minlsh, count_vectorizer_func
--- a/tox.ini	Tue Dec 03 14:46:43 2019 +0100
+++ b/tox.ini	Tue Dec 03 14:51:27 2019 +0100
@@ -1,11 +1,12 @@
 [tox]
-envlist = py3,flake8
+envlist = py2,py3,flake8
 
 [testenv]
 deps =
   pytest
   nltk
   SPARQLWrapper
+  mock
 commands =
   {envpython} -m pytest {posargs:test}