A pytest plugin for testing Jupyter libraries and extensions.
Project description
pytest-jupyter
A set of pytest plugins for Jupyter libraries and extensions.
Basic Usage
First, install pytest-jupyter from PyPI using pip:
pip install pytest-jupyter
This installs the basic pytest-jupyter package that includes fixture definitions for the various Jupyter-based pytest plugins.
To use one of these plugins, you'll also need to install their dependencies. This requires a second pip install call. For example, if you'd like to use the jupyter_server plugin, you'll need to call:
pip install "pytest-jupyter[server]"
This should install everything you need for the plugin to work.
To use a plugin, add it to the pytest_plugins list in the conftest.py of your project's root test directory.
# inside the conftest.py
pytest_plugins = ["pytest_jupyter.jupyter_server"]
All fixtures inside the plugin (e.g. jupyter_server) will be available to all of your project's unit tests. You can use a fixtures by passing it as an argument to your unit test function:
async def test_jupyter_server_api(jp_fetch):
# Send request to a temporary Jupyter Server Web Application
response = await jp_fetch("api/spec.yml")
# Confirm that the request is successful.
assert response.code == 200
You can list the fixtures for a given plugin using the --fixtures argument from the pytest command line interface:
pytest --fixtures -p pytest_jupyter.jupyter_server
or by calling the pytest --fixtures where the plugin is listed in the pytest_plugins variable of a given test directory.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_jupyter-0.1.0.tar.gz.
File metadata
- Download URL: pytest_jupyter-0.1.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39816602a4d7c4fced17eb9554143381d300095e8b844f4ed88108d7e32d975d
|
|
| MD5 |
a2435efd9588118f0821c9a9d8281ad2
|
|
| BLAKE2b-256 |
46b47471e2ae7a4bde7fa6982c6fe2e89dddaee77d509f1cff07b02d532aaa5d
|
File details
Details for the file pytest_jupyter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pytest_jupyter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c852d6445d884c014124bb2184bc0e68f940813602623d8c9cb9ab182e10acb
|
|
| MD5 |
c93b4776c218dd3b922d63729744ac83
|
|
| BLAKE2b-256 |
b2c1cf3eaa1cbf19659de48a52fbd8b2f6240844ce28bbd1217516f019d079d9
|