Assert that tox uses the appropriate Python version
This commit is contained in:
parent
606e77a1ba
commit
74239cac5d
1 changed files with 19 additions and 5 deletions
|
|
@ -86,6 +86,23 @@ set -u
|
|||
|
||||
# use it with tox
|
||||
[[ "$TOX" != "true" ]] && exit 0
|
||||
if [[ $PYTHON == python* ]]; then
|
||||
export TOXENV=py${VERSION/./}
|
||||
else
|
||||
export TOXENV=$PYTHON
|
||||
fi
|
||||
|
||||
cat > tox.ini << EOF
|
||||
[tox]
|
||||
skipsdist = True
|
||||
[testenv]
|
||||
commands = python -c 'import sys; print(sys.version)'
|
||||
EOF
|
||||
|
||||
# Tests that the Python version used in tox is really the Python version we want
|
||||
tox | tee toxlog
|
||||
grep "^$VERSION\.[0-9]" toxlog
|
||||
|
||||
cat > tox.ini << EOF
|
||||
[tox]
|
||||
skipsdist = True
|
||||
|
|
@ -94,8 +111,5 @@ deps = pytest
|
|||
commands = python -m pytest -v test_foo.py
|
||||
EOF
|
||||
|
||||
if [[ $PYTHON == python* ]]; then
|
||||
tox -e py${VERSION/./}
|
||||
else
|
||||
tox -e $PYTHON
|
||||
fi
|
||||
# A more complex example with pytest
|
||||
tox
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue