With widespread use of Jupyter Notebooks, it becomes important to write maintainable and reliable notebooks. testbook helps you unit test your notebooks in the conventional unit testing style, with the tests existing as a separate entity.
electronics engineering student - Google Summer of Code 2020 student working on testbook under the mentorship of Matthew Seal (@codeseal) - Love Python and C github.com/rohitsanj @imrohitsanj rohitsanjay.com
data science experiments in Jupyter Notebooks can get messy. Enforcing good coding habits in Jupyter Notebooks can lead to maintainable and easily refactorable code. Some good habits are.. • Use functions to abstract away complexity • Smuggle code out of Jupyter notebooks as soon as possible • Apply test driven development • Make small and frequent commits Source: https://www.thoughtworks.com/insights/blog/coding-habits-data-scientists
Write the tests in the notebook itself • Refactor code out of the notebooks and write them in separate Python modules that can then be independently unit tested.
tests directly for Jupyter Notebooks, without refactoring code out of it into separate Python modules. Testbook can now help you write maintainable and reliable Jupyter Notebooks.
Execute all or some specific cells before unit test • Share kernel context across multiple tests (using pytest fixtures) • Inject code into Jupyter notebooks • Works with any unit testing library - pytest, unittest or nose