Browse Source

tests: switch to python3

merge-requests/111/head
Daniel Martí 4 years ago
parent
commit
24ad0418e3
9 changed files with 13 additions and 20 deletions
  1. +1
    -2
      tests/build.TestCase
  2. +1
    -2
      tests/common.TestCase
  3. +5
    -5
      tests/complete-ci-tests
  4. +1
    -2
      tests/description-parsing.py
  5. +1
    -2
      tests/import.TestCase
  6. +1
    -2
      tests/install.TestCase
  7. +1
    -2
      tests/metadata.TestCase
  8. +1
    -1
      tests/run-tests
  9. +1
    -2
      tests/update.TestCase

+ 1
- 2
tests/build.TestCase View File

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

+ 1
- 2
tests/common.TestCase View File

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

+ 5
- 5
tests/complete-ci-tests View File

@ -51,10 +51,10 @@ cd $WORKSPACE/tests
#------------------------------------------------------------------------------#
# test building the source tarball, then installing it
cd $WORKSPACE
python2 setup.py sdist
python3 setup.py sdist
rm -rf $WORKSPACE/env
virtualenv --python=python2 $WORKSPACE/env
virtualenv --python=python3 $WORKSPACE/env
. $WORKSPACE/env/bin/activate
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
cd $WORKSPACE
rm -rf $WORKSPACE/env
virtualenv --python=python2 --system-site-packages $WORKSPACE/env
virtualenv --python=python3 --system-site-packages $WORKSPACE/env
. $WORKSPACE/env/bin/activate
pip install -e $WORKSPACE
python2 setup.py install
python3 setup.py install
# run tests in new pip+virtualenv install
fdroid=$WORKSPACE/env/bin/fdroid $WORKSPACE/tests/run-tests $apksource
@ -86,7 +86,7 @@ sh hooks/pre-commit
cd $WORKSPACE
set +e
# 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 \
--load-plugins astng_hashlib \
fdroidserver/*.py fdroid makebuildserver setup.py > $WORKSPACE/pylint.parseable

+ 1
- 2
tests/description-parsing.py View File

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

+ 1
- 2
tests/import.TestCase View File

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

+ 1
- 2
tests/install.TestCase View File

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

+ 1
- 2
tests/metadata.TestCase View File

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

+ 1
- 1
tests/run-tests View File

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

+ 1
- 2
tests/update.TestCase View File

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

Loading…
Cancel
Save