From a9b29a7ecdeb5dcd7e0e89a1493bfa9ae5fbd23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Pat=C3=B3?= Date: Fri, 11 Jun 2021 23:44:37 -0700 Subject: [PATCH] fixing notebook test errors when no tests collected --- check/pytest | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/check/pytest b/check/pytest index 838d94e4f1a..1eb844b11f6 100755 --- a/check/pytest +++ b/check/pytest @@ -41,9 +41,17 @@ fi if [ -z "${ACTUALLY_QUIET}" ]; then pytest "${PYTEST_ARGS[@]}" + RESULT=$? else # Filter out lines like "...F....x... [ 42%]", with coloring. pytest -q --color=yes "${PYTEST_ARGS[@]}" | perl -nle'print if not m{^(.\[0m)?[\.FEsx]+(.\[36m)?\s+\[\s*\d+%\](.\[0m)?$}' - exit "${PIPESTATUS[0]}" + RESULT=${PIPESTATUS[0]} fi + +if [ "$RESULT" = 5 ]; then + echo "[exit 5] No tests collected, but ignored." + exit 0 +fi + +exit "$RESULT" \ No newline at end of file