-
Notifications
You must be signed in to change notification settings - Fork 641
Open
Description
🚀 The feature, motivation and pitch
Overview
Automate testing for notebooks in examples/notebooks/ to ensure they remain executable and up-to-date.
Current Notebooks
Cybersecurity_demo.ipynbLlamaGuard.ipynbLlamaGuardMM.ipynb
Recommended Approach
Use nbmake for execution testing + testbook for detailed unit tests.
nbmake (execution testing)
pytest --nbmake examples/notebooks/*.ipynb testbook (unit testing)
@testbook('examples/notebooks/LlamaGuard.ipynb', execute=True)
def test_llamaguard_notebook(tb):
tb.execute_cell([0, 1, 2])
assert tb.ref('some_variable') is not None
Dependencies to Add
nbmake>=1.4.0
testbook>=0.4.2
jupyter>=1.0.0
Implementation Notes
- Mock external API calls
- Set appropriate cell timeouts
- Create fixtures for common test data
- Configure in pytest.ini
Success Criteria
- Dependencies added
- All notebooks execute successfully
- Test configuration in pytest.ini
- Mock fixtures for external dependencies
- Documentation updated
Alternatives
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels