Skip to content

Commit

Permalink
tests: allow execution of selected pytests only
Browse files Browse the repository at this point in the history
Allows execution of selected pytests via PYTESTARG environment variable.
Example: `PYTESTARG="-k test_version" ./run-tests.sh --check-pytest`.

Cleans up running DB container when some pytest segfaults.

Closes reanahub/reana#755.
  • Loading branch information
tiborsimko committed Nov 3, 2023
1 parent e9d08bf commit 30b0ca6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ check_sphinx () {
check_pytest () {
clean_old_db_container
start_db_container
python setup.py test
trap clean_old_db_container SIGINT SIGTERM SIGSEGV ERR
if [ -n "${PYTESTARG-}" ]; then
pytest "$PYTESTARG"
else
python setup.py test
fi
stop_db_container
}

Expand Down

0 comments on commit 30b0ca6

Please sign in to comment.