Skip to content

Commit 697fb0c

Browse files
abncrobinso
authored andcommitted
Skip tests if virtual environment is not active
1 parent e1a094d commit 697fb0c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

contrib/run-tests

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ ARGS="$@"
1111

1212
for BIN in python2 python3; do
1313
if command -v ${BIN} >/dev/null 2>&1; then
14-
echo "INFO: Running tests for ${BIN}"
14+
echo "INFO: Activating environment for ${BIN}"
1515
. ./contrib/activate-dev-env ${BIN}
16-
python setup.py test ${ARGS}
17-
echo "INFO: Tests completed for ${BIN}"
16+
if [ -z ${VIRTUAL_ENV} ]; then
17+
echo "WARN: Virtual Environment not active, skipping tests."
18+
else
19+
echo "INFO: Running tests for ${BIN}"
20+
python setup.py test ${ARGS}
21+
echo "INFO: Tests completed for ${BIN}"
22+
fi
1823
else
1924
echo "INFO: ${BIN} not found, skipping tests."
2025
fi

0 commit comments

Comments
 (0)