forked from getsentry/sentry-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruntox.sh
More file actions
executable file
·30 lines (26 loc) · 870 Bytes
/
runtox.sh
File metadata and controls
executable file
·30 lines (26 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -ex
if [ -n "$TOXPATH" ]; then
true
elif which tox &> /dev/null; then
TOXPATH=tox
else
TOXPATH=./.venv/bin/tox
fi
# Usage: sh scripts/runtox.sh py3.7 <pytest-args>
# Runs all environments with substring py3.7 and the given arguments for pytest
if [ -n "$1" ]; then
searchstring="$1"
elif [ -n "$CI_PYTHON_VERSION" ]; then
searchstring="$(echo py$CI_PYTHON_VERSION | sed -e 's/pypypy/pypy/g' -e 's/-dev//g')"
if [ "$searchstring" = "pypy-2.7" ]; then
searchstring=pypy
fi
elif [ -n "$AZURE_PYTHON_VERSION" ]; then
searchstring="$(echo py$AZURE_PYTHON_VERSION | sed -e 's/pypypy/pypy/g' -e 's/-dev//g')"
if [ "$searchstring" = pypy2 ]; then
searchstring=pypy
fi
fi
export TOX_PARALLEL_NO_SPINNER=1
exec $TOXPATH --parallel auto -e $($TOXPATH -l | grep "$searchstring" | tr $'\n' ',') -- "${@:2}"