tox: also run tests against python 3

This commit is contained in:
Frédéric Péters 2018-03-27 08:59:04 +02:00
parent 8252e948e7
commit 250476911c
2 changed files with 23 additions and 2 deletions

19
getlasso3.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
# Get venv site-packages path
DSTDIR=`python3 -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
# Get not venv site-packages path
# Remove first path (assuming that is the venv path)
NONPATH=`echo $PATH | sed 's/^[^:]*://'`
SRCDIR=`PATH=$NONPATH python3 -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
# Clean up
rm -f $DSTDIR/lasso.*
rm -f $DSTDIR/_lasso.*
# Link
ln -sv /usr/lib/python3/dist-packages/lasso.py $DSTDIR/
ln -sv /usr/lib/python3/dist-packages/_lasso.cpython-36m-x86_64-linux-gnu.so $DSTDIR/
exit 0

View File

@ -1,5 +1,5 @@
[tox]
envlist = {coverage-,}{dj18,dj111}-{pg,sqlite}
envlist = {coverage-,}py2-{dj18,dj111}-{pg,sqlite},py3-dj111-{pg,sqlite}
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/django-mellon/
[testenv]
@ -18,6 +18,7 @@ deps =
dj18: django>1.8,<1.9
dj111: django>1.11,<1.12
pg: psycopg2
mock
httmock
pytest
pytest-cov
@ -31,6 +32,7 @@ deps =
WebTest
pyquery
commands =
./getlasso.sh
py2: ./getlasso.sh
py3: ./getlasso3.sh
py.test --random {env:COVERAGE:} {posargs:tests}
coverage: mv coverage.xml coverage-{envname}.xml