Skip to content

Commit

Permalink
Added pytest notebook link checking
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlaw committed Jul 27, 2022
1 parent 55dcada commit bd1beb4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ dependencies:
- scikit-learn>=0.21.3
- numpydoc>=1.1.0
- build>=0.7.0
- pytest-check-links>=0.7.1
11 changes: 11 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand 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
Expand Down

0 comments on commit bd1beb4

Please sign in to comment.