Traditionally Jupyter Notebook users have had an excellent experience around exploring code solutions with an interactive development environment. However, the Jupyter Notebook document that’s produced – the .ipynb file – was not easily testable in the same variety of coding situations as other extension formats like plain .py files. For certain situations end-to-end execution tools like papermill allow for testing the entire document as one unit, but individual unittesting of code snippets from the file was difficult or impossible to achieve without exporting to a new format and refactoring.
Notebooks in recent years have exploded in popularity, with millions of notebooks on github alone. To alleviate the pain point for testing these notebooks, we created a new library called testbook. The testbook library is a unit testing framework for testing code in Jupyter Notebooks with pytest patterns.
Previous attempts at unit testing notebooks involved writing the tests in the notebook itself, which was faulty, difficult to read, and even more difficult to maintain. However, testbook allows for unit tests to be run against notebooks in separate test files, hence treating .ipynb files as .py files.
This talk is for anyone has ever worked with Jupyter Notebooks. Common users of notebooks are Data Scientists, Data Engineers, System Automation Engineers, and Teachers.
Basic knowledge of testing in Python. Preferred but not required to know about notebook systems.
https://www.youtube.com/watch?v=KN8k7qK9L1Q
A shorter version of this talk was delivered as a lightning talk at SciPy 2020. The slides can be found here and the video over here.
Testbook links:
GitHub - https://github.com/nteract/testbook
Documentation - https://test-book.readthedocs.io
PyPI - https://pypi.org/project/testbook
Rohit is a final year engineering student at MIT Manipal. He is an open source enthusiast and is a Google Summer of Code 2020 intern at NumFocus where he worked on implementing testbook from scratch with the mentorship of Matthew Seal.
Links:
Matthew is the CTO at Noteable, a VC funded startup focusing on Notebook services. Before Noteable he was at Netflix working on orchestration and integration systems, which included novel uses of notebooks in production systems. Matt is a maintainer for a number of jupyter libraries including papermill.
Links:
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing