-
Notifications
You must be signed in to change notification settings - Fork 892
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add script and job to test tutorials
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import glob | ||
|
||
import pytest | ||
|
||
# Locate all notebooks in docs and subdirectories | ||
notebooks = glob.glob("docs/**/*.ipynb", recursive=True) | ||
|
||
|
||
# Parameterize the test with all found notebooks | ||
@pytest.mark.parametrize("notebook", notebooks) | ||
def test_notebook_execution(notebook): | ||
# This runs each notebook using nbval and ensures there are no errors | ||
pytest.main( | ||
[ | ||
"--nbval", | ||
"--current-env", # Use the current environment | ||
"--sanitize-with", | ||
".sanitize_config.yaml", # Optional: If you want to handle variable output, use this | ||
notebook, | ||
] | ||
) |