tests: switch to python3

This commit is contained in:
Daniel Martí 2016-01-04 21:17:58 +01:00
parent a1703f1204
commit 24ad0418e3
9 changed files with 13 additions and 20 deletions

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# http://www.drdobbs.com/testing/unit-testing-with-python/240165163 # http://www.drdobbs.com/testing/unit-testing-with-python/240165163

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# http://www.drdobbs.com/testing/unit-testing-with-python/240165163 # http://www.drdobbs.com/testing/unit-testing-with-python/240165163

View File

@ -51,10 +51,10 @@ cd $WORKSPACE/tests
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#
# test building the source tarball, then installing it # test building the source tarball, then installing it
cd $WORKSPACE cd $WORKSPACE
python2 setup.py sdist python3 setup.py sdist
rm -rf $WORKSPACE/env rm -rf $WORKSPACE/env
virtualenv --python=python2 $WORKSPACE/env virtualenv --python=python3 $WORKSPACE/env
. $WORKSPACE/env/bin/activate . $WORKSPACE/env/bin/activate
pip install dist/fdroidserver-*.tar.gz pip install dist/fdroidserver-*.tar.gz
@ -66,10 +66,10 @@ fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests $apksource
# test install using install direct from git repo # test install using install direct from git repo
cd $WORKSPACE cd $WORKSPACE
rm -rf $WORKSPACE/env rm -rf $WORKSPACE/env
virtualenv --python=python2 --system-site-packages $WORKSPACE/env virtualenv --python=python3 --system-site-packages $WORKSPACE/env
. $WORKSPACE/env/bin/activate . $WORKSPACE/env/bin/activate
pip install -e $WORKSPACE pip install -e $WORKSPACE
python2 setup.py install python3 setup.py install
# run tests in new pip+virtualenv install # run tests in new pip+virtualenv install
fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests $apksource fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests $apksource
@ -86,7 +86,7 @@ sh hooks/pre-commit
cd $WORKSPACE cd $WORKSPACE
set +e set +e
# use the virtualenv python so pylint checks against its installed libs # use the virtualenv python so pylint checks against its installed libs
PYTHONPATH=$WORKSPACE/.pylint-plugins python2 /usr/bin/pylint \ PYTHONPATH=$WORKSPACE/.pylint-plugins python3 /usr/bin/pylint \
--output-format=parseable --reports=n \ --output-format=parseable --reports=n \
--load-plugins astng_hashlib \ --load-plugins astng_hashlib \
fdroidserver/*.py fdroid makebuildserver setup.py > $WORKSPACE/pylint.parseable fdroidserver/*.py fdroid makebuildserver setup.py > $WORKSPACE/pylint.parseable

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os import os
import sys import sys

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# http://www.drdobbs.com/testing/unit-testing-with-python/240165163 # http://www.drdobbs.com/testing/unit-testing-with-python/240165163

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# http://www.drdobbs.com/testing/unit-testing-with-python/240165163 # http://www.drdobbs.com/testing/unit-testing-with-python/240165163

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# http://www.drdobbs.com/testing/unit-testing-with-python/240165163 # http://www.drdobbs.com/testing/unit-testing-with-python/240165163

View File

@ -83,7 +83,7 @@ fi
# allow the location of python to be overridden # allow the location of python to be overridden
if [ -z $python ]; then if [ -z $python ]; then
python=python2 python=python3
fi fi
set -x # show each command as it is executed set -x # show each command as it is executed

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python2 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# http://www.drdobbs.com/testing/unit-testing-with-python/240165163 # http://www.drdobbs.com/testing/unit-testing-with-python/240165163