$npx skillfedfor your agent

pytest-operator

Fixtures for Charmed Operators

With conditionsPyPI TestingReleased Oct 2025152.5K downloads / moApachePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_operator-0.43.2-py3-none-any.whl
v0.43.2 · released 2025-10-04 · Python >=3.8 · 6 runtime deps: ipdb, pytest, pytest-asyncio, pyyaml, juju, jinja2

Yes, if you are writing integration tests for Juju operator charms. The plugin is actively maintained, has no known vulnerabilities, uses a permissive license, and provides real value by reducing boilerplate for a specialized testing domain. The low install friction and stable dependency set make it a straightforward addition to a charm testing workflow.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.8 or later; assumes you have a Juju environment available for the ops_test fixture to connect to.
  • Low friction installation; active maintenance with a recent release (2025-10-04) and last commit on 2026-04-09.
  • Depends on pytest, juju, and pytest-asyncio, all standard testing libraries.

License · maintenance · safety

Apache (permissive) — Apache license (permissive) means you can use this in commercial and open-source projects with minimal restrictions; include a copy of the license and note any modifications.

last release 2025-10-04 (314 days) · last repo commit 2026-04-09 · 10 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 152,528 downloads/mo, #10,898 on PyPI

Verify before relying

# In tox.ini or requirements:
pip install pytest-operator

# In your test file:
import pytest

@pytest.mark.abort_on_fail
async def test_build_and_deploy(ops_test):
    my_charm = await ops_test.build_charm(".")
    await ops_test.model.deploy(my_charm)
    await ops_test.model.wait_for_idle()
  • Whether the package requires a running Juju controller or if it can mock/stub the Juju connection for unit testing.
  • Performance characteristics when running large numbers of integration tests in parallel.
  • Compatibility with different Juju versions beyond what the classifiers indicate.
Same gist for agents: .md · .json

What it is and what it does

pytest-operator is a pytest plugin designed to simplify writing integration tests for Juju operator charms. It provides an `ops_test` fixture that wraps a libjuju Model and offers helper methods for building charms, managing resources, rendering bundles, and deploying to a Juju environment. The fixture is module-scoped and includes conveniences like automatic async test marking and the ability to abort remaining tests in a module if a critical test fails.

You use it by including it in your test dependencies and then calling methods like `ops_test.build_charm()`, `ops_test.build_resources()`, and `ops_test.model.deploy()` within async test functions. It handles the boilerplate of connecting to a Juju model and provides utilities for rendering Jinja2 templates (for bundle files) and running juju CLI commands directly when needed.

Use it for

  • Test charm deployment and lifecycle by building a charm locally and verifying it reaches active status.
  • Validate charm resources are correctly built or downloaded and attached during deployment.
  • Render and deploy multi-charm bundles with templated configuration for integration testing.
  • Verify charm behavior after deployment by inspecting model state and application status.
  • Abort a test module early if an initial deployment test fails, marking dependent tests as xfailed.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you are writing integration tests for Juju operator charms.

The plugin is actively maintained, has no known vulnerabilities, uses a permissive license, and provides real value by reducing boilerplate for a specialized testing domain. The low install friction and stable dependency set make it a straightforward addition to a charm testing workflow.

Install

pytest-operator on PyPI

Before you install

Low friction installation; active maintenance with a recent release (2025-10-04) and last commit on 2026-04-09. Depends on pytest, juju, and pytest-asyncio, all standard testing libraries.

Requires Python 3.8 or later; assumes you have a Juju environment available for the ops_test fixture to connect to.

License in practice

Apache license (permissive) means you can use this in commercial and open-source projects with minimal restrictions; include a copy of the license and note any modifications.

Quickstart

# In tox.ini or requirements:
pip install pytest-operator

# In your test file:
import pytest

@pytest.mark.abort_on_fail
async def test_build_and_deploy(ops_test):
    my_charm = await ops_test.build_charm(".")
    await ops_test.model.deploy(my_charm)
    await ops_test.model.wait_for_idle()

Verify before relying

  • Whether the package requires a running Juju controller or if it can mock/stub the Juju connection for unit testing.
  • Performance characteristics when running large numbers of integration tests in parallel.
  • Compatibility with different Juju versions beyond what the classifiers indicate.

Package facts

LicenseApache permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
6 packages
ipdbpytestpytest-asynciopyyamljujujinja2
MaintenanceActively maintained 314 days since the last release
Last repo commit
First released
Downloads152,528 / month, #10,898 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Evidence: pytest_operator-0.43.2-py3-none-any.whl

Tags

Capabilities
pytest operator charm testingjuju charm integration testsoperator charm test fixturespytest juju deploymentcharm resource testingoperator integration testing framework
Topics
juju-charmsintegration-testingoperator-framework
PyPI keywords
pytestpy.testoperatorsops

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 › “pytest operator charm testing”

  • pytest-operatorA pytest plugin that provides fixtures and helpers for writing…
  • jubilantJubilant wraps the Juju CLI with a type-annotated Python interface,…
  • ops-scenarioops-scenario is a state-transition testing framework for Ops charms…

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

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.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

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.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

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.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

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.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

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.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also ops-scenario · ops · jubilant · cosl · pytest-factoryboy · pytest-aio · pytest-markdown-docs · pytest-redis · data-platform-helpers · pytest-lazy-fixture