This reverts commit ac7fca7141f4bc81774f97496fda958152aaa3c6. As the old saying goes, a shell script is worth a thousand words...
29 lines
452 B
Bash
Executable File
29 lines
452 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# exit if any subcommand return non-zero status
|
|
set -e
|
|
|
|
# Choose python version
|
|
if test "x$1" = x-3; then
|
|
PYTHON=python3
|
|
shift
|
|
elif test "x$1" = x-2; then
|
|
PYTHON=python2
|
|
shift
|
|
fi
|
|
test "x$PYTHON" = x && PYTHON=python
|
|
|
|
# Find tests
|
|
FILTERS=
|
|
for arg in "$@"; do
|
|
test "x$FILTERS" != x && FILTERS="$FILTERS or "
|
|
FILTERS="$FILTERS$arg"
|
|
done
|
|
|
|
# Run tests
|
|
if [ -z "$FILTERS" ]; then
|
|
$PYTHON -m pytest
|
|
else
|
|
$PYTHON -m pytest -k "$FILTERS"
|
|
fi
|