论文标题
使用Jupyter笔记本测试:笔记本验证(NBVAL)pytest插件
Testing with Jupyter notebooks: NoteBook VALidation (nbval) plug-in for pytest
论文作者
论文摘要
笔记本验证工具NBVAL允许从Jupyter Notebook文件加载和执行Python代码。在计算笔记本中单元格的输出时,将这些输出与笔记本文件中保存的输出进行比较,将每个单元视为测试。偏差报告为测试故障,并提供各种配置选项来控制行为。应用程序用例包括基于笔记本的文档,教程和教科书的验证,以及将笔记本作为附加单元的使用,集成和系统测试,用于笔记本中使用的库。 NBVAL被用作PYTest测试软件的插件。
The Notebook validation tool nbval allows to load and execute Python code from a Jupyter notebook file. While computing outputs from the cells in the notebook, these outputs are compared with the outputs saved in the notebook file, treating each cell as a test. Deviations are reported as test failures, with various configuration options available to control the behaviour. Application use cases include the validation of notebook-based documentation, tutorials and textbooks, as well as the use of notebooks as additional unit, integration and system tests for the libraries that are used in the notebook. Nbval is implemented as a plugin for the pytest testing software.