fix some testing.

* Python3 test support
* Specify depended library version for Python2.4, 2.5
This commit is contained in:
Takayuki Shimizukawa
2012-05-01 15:21:12 +09:00
parent 9af2094ca4
commit 4713ca78ba
2 changed files with 19 additions and 7 deletions
+10 -5
View File
@@ -11,19 +11,24 @@
"""
import sys
from os import path, chdir, listdir
from os import path, chdir, listdir, environ
if sys.version_info >= (3, 0):
print('Copying and converting sources to build/lib/tests...')
from distutils.util import copydir_run_2to3
testroot = path.dirname(__file__) or '.'
newroot = path.join(testroot, path.pardir, 'build')
newroot = path.join(newroot, listdir(newroot)[0], 'tests')
if 'BUILD_TEST_PATH' in environ:
# for tox test.
newroot = environ['BUILD_TEST_PATH']
# tox install sphinx package, not need sys.path.insert.
else:
newroot = path.join(testroot, path.pardir, 'build')
newroot = path.join(newroot, listdir(newroot)[0], 'tests')
# always test the sphinx package from build/lib/
sys.path.insert(0, path.join(newroot, path.pardir))
copydir_run_2to3(testroot, newroot)
# switch to the converted dir so nose tests the right tests
chdir(newroot)
# always test the sphinx package from build/lib/
sys.path.insert(0, path.pardir)
else:
# always test the sphinx package from this directory
sys.path.insert(0, path.join(path.dirname(__file__), path.pardir))
+9 -2
View File
@@ -4,14 +4,21 @@ envlist=py24,py25,py26,py27,py31,py32,pypy,du08,du07,du06,du05
[testenv]
deps=
nose
setenv =
BUILD_TEST_PATH = {envdir}/tests
commands=
nosetests
{envpython} tests/run.py {posargs}
sphinx-build -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html
[testenv:py24]
deps=
nose
simplejson
simplejson==2.1.0
[testenv:py25]
deps=
nose
simplejson==2.5.0
[testenv:pypy]
deps=