![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
testbook is a unit testing framework extension for testing code in Jupyter Notebooks.
Previous attempts at unit testing notebooks involved writing the tests in the notebook itself. However, testbook will allow for unit tests to be run against notebooks in separate test files, hence treating .ipynb files as .py files.
testbook helps you set up conventional unit tests for your Jupyter Notebooks.
Here is an example of a unit test written using testbook
Consider the following code cell in a Jupyter Notebook:
def func(a, b):
return a + b
You would write a unit test using testbook
in a Python file as follows:
from testbook import testbook
@testbook('/path/to/notebook.ipynb', execute=True)
def test_func(tb):
func = tb.get("func")
assert func(1, 2) == 3
testbook
pip install testbook
NOTE: This does not install any kernels for running your notebooks. You'll need to install in the same way you do for running the notebooks normally. Usually this is done with pip install ipykernel
Alternatively if you want all the same dev dependencies and the ipython kernel you can install these dependencies with:
pip install testbook[dev]
See readthedocs for more in-depth details.
Read CONTRIBUTING.md for guidelines on how to setup a local development environment and make code changes back to testbook.
FAQs
A unit testing framework for Jupyter Notebooks
We found that testbook demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.