ipytest
Unit tests in IPython notebooks
Decision gist · record as of 2026-08-14
Yes, if you work in Jupyter notebooks and want to run pytest without leaving the environment. The package is stable, has no known vulnerabilities, and low install friction. The 845-day dormancy is a minor concern but not a blocker for a mature, narrow-scope tool. Install it if interactive testing in notebooks fits your workflow; skip it if you already run tests in a separate CI/test runner.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires IPython/Jupyter notebook environment; some notebook implementations may not support magics correctly, in which case ipytest.run() and ipytest.clean() can be used directly.
- Low install friction with a pure-Python wheel.
- Maintenance is dormant (845 days since last release), but the package is stable and supports current Python versions (3.8–3.12).
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute ipytest freely in commercial and private projects with minimal restrictions.
last release 2024-04-21 (845 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 77,508 downloads/mo, #14,519 on PyPI
Alternatives
Verify before relying
pip install ipytest
import ipytest
ipytest.autoconfig()
# In a new cell:
%%ipytest -qq
def test_example():
assert [1, 2, 3] == [1, 2, 3]- Whether the 845-day dormancy affects compatibility with the latest Jupyter/IPython releases.
- Performance impact when running large test suites in notebooks with the assertion rewriter enabled globally.
What it is and what it does
ipytest bridges pytest and Jupyter notebooks, letting you write and run unit tests interactively without leaving the notebook environment. It registers pytest's assertion rewriter with IPython for better error messages, handles the notebook-to-module mapping pytest needs, and cleans up test state between cell executions to avoid stale test definitions.
The package depends on ipython, packaging, and pytest. It's designed to make it easy to prototype tests in notebooks and later move them to separate test files. It handles common notebook gotchas like module caching and async event loop interference, offering options like force_reload() and run_in_thread mode to work around them.
Use it for
- Prototyping unit tests interactively in a notebook before moving them to a dedicated test file.
- Teaching or documenting code behavior by writing and running tests inline with explanatory text.
- Testing data science or analysis code iteratively without switching between notebook and terminal.
- Debugging test failures by running pytest with full notebook context and repl access.
- Validating module behavior during development when using IPython's autoreload extension.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work in Jupyter notebooks and want to run pytest without leaving the environment.
The package is stable, has no known vulnerabilities, and low install friction. The 845-day dormancy is a minor concern but not a blocker for a mature, narrow-scope tool. Install it if interactive testing in notebooks fits your workflow; skip it if you already run tests in a separate CI/test runner.
Install
ipytest on PyPI
Before you install
Low install friction with a pure-Python wheel. Maintenance is dormant (845 days since last release), but the package is stable and supports current Python versions (3.8–3.12).
Requires IPython/Jupyter notebook environment; some notebook implementations may not support magics correctly, in which case ipytest.run() and ipytest.clean() can be used directly.
License in practice
MIT license is permissive; you can use, modify, and distribute ipytest freely in commercial and private projects with minimal restrictions.
Quickstart
pip install ipytest
import ipytest
ipytest.autoconfig()
# In a new cell:
%%ipytest -qq
def test_example():
assert [1, 2, 3] == [1, 2, 3]
Verify before relying
- Whether the 845-day dormancy affects compatibility with the latest Jupyter/IPython releases.
- Performance impact when running large test suites in notebooks with the assertion rewriter enabled globally.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4,>=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesipythonpackagingpytest |
| Maintenance | Dormant 845 days since the last release |
| First released | |
| Downloads | 77,508 / month, #14,519 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Testing |
Evidence: ipytest-0.14.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ipython notebook testing”
- ipytestRuns pytest test suites directly in Jupyter notebooks with full…
- ipywidgetsipywidgets provides interactive HTML widgets (sliders, buttons, text…
- watermarkWatermark is an IPython magic extension that prints date/time stamps,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also nbval · nbmake · testbook · ipykernel · pytest-runner · nbqa · pytest-django · notebook · ipywidgets · emr-notebooks-magics