Skip to main content

pytest-jupyter-deploy

Pytest plugin for E2E testing of jupyter-deploy templates.

Overview

This package provides pytest fixtures and utilities for writing end-to-end tests for jupyter-deploy templates. It handles deployment lifecycle management, configuration loading, and provides helpers for testing web applications with Playwright.

Installation

pip install pytest-jupyter-deploy

For UI testing with Playwright:

pip install "pytest-jupyter-deploy[ui]"
playwright install firefox

Fixtures

  • e2e_deployment (session-scoped): Manages deployment lifecycle (init, config, up, down)
  • e2e_config (session-scoped): Provides access to suite configuration
  • e2e_suite_dir (session-scoped): Path to the E2E tests directory
  • github_oauth_app (function-scoped): Helper for GitHub OAuth2 Proxy authentication with passkey support

Usage

The plugin is automatically loaded by pytest when installed. Use the provided fixtures in your tests.

Example Test

from pytest_jupyter_deploy.deployment import EndToEndDeployment


def test_host_running(e2e_deployment: EndToEndDeployment) -> None:
    """Test that the host is running."""
    e2e_deployment.ensure_deployed()
    host_status = e2e_deployment.cli.get_host_status()
    assert host_status == "running"

Running Tests

# Run E2E tests
pytest -m e2e

# Run against existing deployment
pytest -m e2e --e2e-existing-project=sandbox3

# Capture screenshots on failure
pytest -m e2e --screenshot only-on-failure

Test Utilities

The plugin provides helper functions to use directly in your tests.

Deployment helpers

from pytest_jupyter_deploy.undeployed_project import undeployed_project


def test_init_project(e2e_config: SuiteConfig) -> None:
    with undeployed_project(e2e_config) as (project_dir, cli):
        result = cli.run_command("show --variables --list")
        assert result.returncode == 0

Decorators

from pytest_jupyter_deploy.plugin import skip_if_testvars_not_set


@skip_if_testvars_not_set(["JD_E2E_USER", "JD_E2E_ORG"])
def test_requires_env_vars(e2e_deployment: EndToEndDeployment) -> None: ...

E2E Test Container Image

This package bundles a Dockerfile and docker-compose.yml for a containerized E2E test environment with Python, Terraform, AWS CLI, kubectl, Helm, and Playwright pre-installed. The image is template-independent and used by the jupyter-deploy justfile to run E2E tests locally.

from pytest_jupyter_deploy.image import IMAGE_PATH
# IMAGE_PATH points to the directory containing Dockerfile and docker-compose.yml

License

The Pytest plugin for Jupyter Deploy templates is licensed under the MIT License.

Metadata

Release files for pytest-jupyter-deploy 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-jupyter-deploy 0.3.4
File Size Uploaded Provenance Actions
pytest_jupyter_deploy-0.3.4.tar.gz 93.9 kB Without provenance Details for pytest_jupyter_deploy-0.3.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-jupyter-deploy 0.3.4
File Interpreter ABI Platform Actions
pytest_jupyter_deploy-0.3.4-py3-none-any.whl Python 3 none any Details for pytest_jupyter_deploy-0.3.4-py3-none-any.whl

Total release size: 197.8 kB

Release files / pytest_jupyter_deploy-0.3.4.tar.gz

Download URL pytest_jupyter_deploy-0.3.4.tar.gz
Size 93.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1076ec0e6eae1b058a5f806eadc04a291379d12b321672607831e240a8373b01
BLAKE2b-256 checksum
How to use checksums
4e543fe0c3da97fbf2b26901c17c08a2bdad9d1ab78a8bf9f174041130b3c0be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pytest_jupyter_deploy-0.3.4-py3-none-any.whl

Download URL pytest_jupyter_deploy-0.3.4-py3-none-any.whl
Size 103.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7c21716310842083d1b4cbd7870762513b9bb2312d0fb90e007784794ccae79
BLAKE2b-256 checksum
How to use checksums
a887346e9d49e5af9a14de1faa80c215e493186e21e432ce2a2fce3983925452
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pytest-jupyter-deploy 0.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page