{"id":21467,"library":"ipytest","title":"ipytest","description":"ipytest provides utilities for running unit tests inside IPython notebooks, allowing inline test definition and execution with pytest. Current version: 0.14.2, requires Python >=3.8 and <4. Releases are infrequent.","status":"active","version":"0.14.2","language":"python","source_language":"en","source_url":"https://github.com/chmp/ipytest","tags":["testing","ipython","notebook","pytest"],"install":[{"cmd":"pip install ipytest","lang":"bash","label":"pip install ipytest"}],"dependencies":[{"reason":"Required for running tests; ipytest is an extension of pytest.","package":"pytest","optional":false},{"reason":"Required for notebook environment; ipytest is designed for IPython.","package":"ipython","optional":false}],"imports":[{"note":"","wrong":"","symbol":"ipytest","correct":"import ipytest"}],"quickstart":{"code":"import ipytest\nimport pytest\n\nipytest.autoconfig()\n\ndef test_example():\n    assert 1 + 1 == 2\n\nipytest.run()","lang":"python","description":"After importing ipytest, call autoconfig() to configure pytest for notebook. Define tests as functions starting with 'test_', then run them with ipytest.run()."},"warnings":[{"fix":"Always import ipytest at the top of your notebook cell before defining test functions.","message":"ipytest must be imported before any test functions are defined, otherwise tests may not be discovered.","severity":"gotcha","affected_versions":"all"},{"fix":"Use ipytest.autoconfig() without arguments. Do not pass config paths.","message":"Version 0.14 changed the autoconfig() signature; now it accepts no arguments and configures automatically. Previously, you had to pass a conftest path.","severity":"breaking","affected_versions":">=0.14.0"},{"fix":"Use ipytest.run() instead of the cell magic.","message":"The ipytest.magics module (e.g., %%run_tests magic) is deprecated in favor of plain Python function calls.","severity":"deprecated","affected_versions":">=0.14.0"},{"fix":"Define tests directly in a notebook cell and execute that cell to register them.","message":"Tests must be defined inside an IPython notebook cell; ipytest does not work if called from a separate .py file via import.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `pip install ipytest` and ensure you are using the same kernel as the installation.","cause":"ipytest is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'ipytest'"},{"fix":"Use ipytest.run() instead of the cell magic. Or load the magics with `%load_ext ipytest.magics` (deprecated).","cause":"The deprecated magic module is not loaded; you may be using a version that removed it.","error":"UsageError: Cell magic `%%run_tests` not found."},{"fix":"Remove arguments: just call `ipytest.autoconfig()` without any parameters.","cause":"You are passing arguments to autoconfig() in version 0.14+, which no longer accepts them.","error":"TypeError: autoconfig() takes 0 positional arguments but 1 was given"},{"fix":"Check that your test function names start with 'test_' and that you have defined them before invoking ipytest.run().","cause":"ipytest.run() could not discover any test functions. Ensure test functions are named with 'test_' prefix and defined before calling run().","error":"ValueError: No tests found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}