{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/3"}],"enrichment":{"capability":"A pytest plugin that treats Jupyter notebooks as test files, executing each cell and validating that outputs match the stored results in the .ipynb file.","skillfed_tags":["jupyter-integration","notebook-testing"],"use_cases":["Validate that tutorial and documentation notebooks execute without errors and produce expected outputs.","Catch breaking changes in dependencies by running notebooks as part of your CI/CD pipeline.","Ensure reproducibility of computational results stored in reference notebooks.","Generate code coverage reports from notebook execution using pytest-cov integration.","Run notebooks in parallel across multiple workers while keeping each notebook's cells on the same kernel."],"what_it_does":"nbval is a pytest plugin that integrates Jupyter notebooks into your test suite. Instead of manually running notebooks to check outputs, nbval treats each code cell as a test case, executing it and comparing the actual output against what was stored in the .ipynb file. This ensures that reference notebooks, documentation, and examples stay in sync with their expected behavior and don't break silently over time.\n\nThe plugin works by launching an IPython kernel, sending each cell's code to it via jupyter-client, and collecting the output messages. It supports output sanitization via regex rules, integration with pytest-cov for coverage reporting, and parallel execution via pytest-xdist (with the `--dist loadscope` flag). You can run all notebooks in a directory with `pytest --nbval`, or target specific files, and use `--nbval-lax` to only check cells marked with `#NBVAL_CHECK_OUTPUT`.","worth_installing":"Yes, if you maintain Jupyter notebooks as part of your documentation or reference material and want to ensure they stay executable and correct. The low install friction and permissive license make it a practical choice. However, note that the project is aging (last release March 2024)\u2014verify compatibility with your current pytest and Jupyter versions before relying on it in new projects."},"id":"nbval","links":{"html":"https://skillfed.io/packages/nbval","md":"https://skillfed.io/packages/nbval.md","pypi":"https://pypi.org/project/nbval/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2024-03-04","license_spdx":null,"license_treatment":"permissive","name":"nbval","python_support":"supports_current","summary":"A py.test plugin to validate Jupyter notebooks"},"popularity":{"monthly_downloads":603339,"position":5811,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.11.0"}
