From bd1beb43283f792a37aee87055c152e3aa69b702 Mon Sep 17 00:00:00 2001 From: Sean Law Date: Tue, 26 Jul 2022 21:54:28 -0400 Subject: [PATCH] Added pytest notebook link checking --- environment.yml | 1 + test.sh | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/environment.yml b/environment.yml index 1c20849b5..6ff45e207 100644 --- a/environment.yml +++ b/environment.yml @@ -22,3 +22,4 @@ dependencies: - scikit-learn>=0.21.3 - numpydoc>=1.1.0 - build>=0.7.0 + - pytest-check-links>=0.7.1 diff --git a/test.sh b/test.sh index 79d0e3913..bf7b4c263 100755 --- a/test.sh +++ b/test.sh @@ -20,6 +20,8 @@ do custom_testfiles+=("$var") elif [[ $var =~ ^[\-0-9]+$ ]]; then max_iter=$var + elif [[ "$var" == "links" ]]; then + test_mode="links" else echo "Using default test_mode=\"all\"" fi @@ -195,6 +197,12 @@ test_coverage() coverage report -m --skip-covered --omit=setup.py } +check_links() +{ + echo "Checking notebook links" + pytest --check-links docs/Tutorial_*.ipynb +} + clean_up() { echo "Cleaning Up" @@ -225,6 +233,9 @@ elif [[ $test_mode == "custom" ]]; then # export NUMBA_DISABLE_JIT=1 # export NUMBA_ENABLE_CUDASIM=1 test_custom +elif [[ $test_mode == "links" ]]; then + echo "Check Notebook Links Only" + check_links else echo "Executing Unit Tests And Code Coverage" test_unit