Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into tpi-cleanup, which
Browse files Browse the repository at this point in the history
incorporates devops changes to better control Jupyter Notebook tests.
From here on out, notebooks to be tested must be prefixed with test_
just like unit tests need a test_ prefix for pytest to run them.

Signed-off-by: Michael Tiemann <[email protected]>
  • Loading branch information
MichaelTiemannOSC committed May 14, 2024
1 parent 0cc9419 commit 0f8f76f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/notebooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ jobs:
pip install pytest nbmake
- name: "Test notebooks: pytest --nbmake"
run: pytest --nbmake -- **/*ipynb
run: |
echo "testing notebooks"
pytest --nbmake -- **/test_*.ipynb
- name: Upload logs as artefacts
if: always()
Expand Down
35 changes: 35 additions & 0 deletions notebooks/test_happy.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "0fecf498-25b1-4608-ab9d-15f0c13e1949",
"metadata": {},
"outputs": [],
"source": [
"print(\"I'm a happy notebook.\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ lint = "pre-commit run --all-files"
complete = { call = "tasks.complete:main", help = "Create autocomplete files for bash and fish" }

[tool.pdm.dev-dependencies]
test = ["pdm[pytest]", "pytest-cov"]
test = ["nbmake", "pdm[pytest]", "pytest-cov"]
tox = ["tox", "tox-pdm>=0.5"]
docs = ["sphinx>=7.2.6", "sphinx-copybutton>=0.5.2"]
dev = ["tox>=4.11.3", "tox-pdm>=0.7.0"]
Expand Down

0 comments on commit 0f8f76f

Please sign in to comment.