~/talk

Unit Testing Jupyter Notebooks - testbook

Talkat PyCascades 2021 · 2021-02-19..02-21· [testing, python]
links:none on file
links:none on file
slides:none on file

testbook is a unit-testing library that treats .ipynb files like .py modules by creating remote reference objects in the notebook kernel, injecting test code and running assertions inside that kernel so complex objects (dataframes, mocks) never need serializing. Features include cell-level execution, shared kernel fixtures, and patching of notebook functions; it already powers automated grading at scale and integrates with pytest/unittest, though it currently flags compatibility issues with ipykernel 5.5.

AI-written summary · about

  1. 0:00Intro
  2. 0:14Unit Testing Jupyter Notebooks - testbook
  3. 3:13What is a Notebook?
  4. 3:41A simple unit test using testbook
  5. 4:32Another example
  6. 5:11Running a Test Suite
  7. 5:37Write conventional unit tests for Jupyter Notebool
  8. 6:04Execute all or some specific cells before unit test
  9. 6:34Share kernel context across multiple tests
  10. 7:05Perform patching of objects in the notebook
  11. 7:45Inject code into Jupyter notebooks
  12. 9:07Works with any unit testing library
  13. 9:31Tests from Testbook's Git
  14. 12:10Writing quality Jupyter Notebooks
  15. 13:08Jupyter Notebooks can get very messy
  16. 14:03Why Test?
  17. 14:47Test driven development for Jupyter Notebooks?
  18. 16:58How testbook works
  19. 19:50Push down to kernel
  20. 20:29Who Should Use Testbook?
  21. 22:01Real World Use case: Autograding notebooks
  22. 23:09What's Coming Up?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.