got tox to run 2to3 on tests before running them with Python 3.x

This commit is contained in:
Tal Einat 2014-03-28 10:48:17 +03:00
parent c12e6c3f2f
commit 8ba0cc8dc3
2 changed files with 20 additions and 6 deletions

View File

@ -35,18 +35,16 @@ class TestGroupMatches(unittest.TestCase):
)
import six
class TestSearchExact(unittest.TestCase):
def search(self, sequence, subsequence):
return list(search_exact(sequence, subsequence))
def test_bytes(self):
text = six.b('abc')
text = 'abc'
self.assertEqual(self.search(text, text), [0])
def test_unicode(self):
text = six.u('abc')
text = u'abc'
self.assertEqual(self.search(text, text), [0])
def test_biopython_Seq(self):

20
tox.ini
View File

@ -2,12 +2,13 @@
envlist = py26, py27, py31, py32, py33
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/searchtml
commands = python setup.py test
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test_requirements.txt
whitelist_externals =
rm
2to3
[testenv:py26]
deps =
@ -22,17 +23,32 @@ deps =
biopython
[testenv:py31]
changedir = {toxworkdir}
commands =
2to3 -n -W --output-dir {envtmpdir}/tests3 {toxinidir}/tests
{envpython} -m unittest2 discover {envtmpdir}/tests3
rm -rf {envtmpdir}/tests3
deps =
unittest2py3k
mock
{[testenv]deps}
[testenv:py32]
changedir = {toxworkdir}
commands =
2to3 -n -W --output-dir {envtmpdir}/tests3 {toxinidir}/tests
{envpython} -m unittest discover {envtmpdir}/tests3
rm -rf {envtmpdir}/tests3
deps =
mock
{[testenv]deps}
[testenv:py33]
changedir = {toxworkdir}
commands =
2to3 -n -W --output-dir {envtmpdir}/tests3 {toxinidir}/tests
{envpython} -m unittest discover {envtmpdir}/tests3
rm -rf {envtmpdir}/tests3
deps =
{[testenv]deps}
biopython