Skip to main content

pytest-helm

pytest-helm makes it easy to test Helm charts in a simple and repeatable fashion.

It runs a helm template command, loads your manifests into a fixture, and then allows you to make simple assertions about it's shape/contents.

Quickstart

Add pytest-helm

uv add pytest-helm

Scaffold out the fixture/test file

We assume you won't have pytest configured for a chart directory, so if that's the case you can run:

uv run pytest-helm --init

That will create two sample test files, a fixture in tests/conftest.py and a test in tests/test_deployment.py.

If you are already using pytest, you can skip this step.

Usage

Define as many fixtures as you'd like in conftest:

# tests/conftest.py
from pytest_helm import manifest_fixture

chart = manifest_fixture(
    "chart",
    ["helm", "template", ".", "-f", "values.yaml"],
)

prod_chart = manifest_fixture(
    "prod_chart",
    ["helm", "template", ".", "-f", "prod-values.yaml"],
)

Write tests to validate the YAML shape/output for different values meets your requirements:

# tests/test_deployments.py
def test_it_provisions_one_replica_by_default(chart):
    api = chart.get("deployment/api-server")
    assert api.spec.replicas == 1

def test_it_provisions_multiple_replicas_in_prod(prod_chart):
    api = prod_chart.get("deployment/api-server")
    assert = api.spec.replicas == 3

Use PDB to programatically inspect your manifests:

def test_idk_what_to_test(chart):
   import pdb; pdb.set_trace()

$ pytest
(Pdb) chart
   ManifestIndex({
        'ConfigMap': ['release-name-base-config'],
        'Deployment': ['release-name-api', 'release-name-worker'],
        'Ingress': ['release-name-app'],
        'Job': ['release-name-db-migrate'],
        'Service': ['release-name-api'],
        'ServiceAccount': ['backend']
   })

(Pdb) chart.get("configmap/release-name-base-config")
Box({'apiVersion': 'v1', 'kind': 'ConfigMap', 'metadata': {'name': 'release-name-base-config'}, 'data': {'EMAIL_FROM': 'foo@bar.com'}})

(Pdb)

Notes:

  • chart.get() is case-insensitive, chart.get("ConfigMap/foo") and chart.get("configmap/foo") are the same thing
  • In the event that two resources have the same name/kind, you are required to pass an apiVersion as well, i.e. v1/ConfigMap/foo

Metadata

Release files for pytest-helm 0.1.1

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-helm 0.1.1
File Size Uploaded Provenance
pytest_helm-0.1.1.tar.gz 20.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-helm 0.1.1
File Interpreter ABI Platform
pytest_helm-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 27.9 kB

Release files / pytest_helm-0.1.1.tar.gz

Download URL pytest_helm-0.1.1.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bb214ccdd0dcbd9d8b21ed68f911e2fc29339a23a412fde109fa19be48f9e88a
BLAKE2b-256 checksum
How to use checksums
90ad986b8a03ae1cb9206928a9a7d327fdd36a6463a57ed6a4abae709c7f4518
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 21, 2026.

Transparency log

Release files / pytest_helm-0.1.1-py3-none-any.whl

Download URL pytest_helm-0.1.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df92db6e08e6aff0fb8e87e603cc63df44dba06c223f2115f281e8a965c801dc
BLAKE2b-256 checksum
How to use checksums
5845078fe9b0daa85321fd4e0abb93e8ddeec2bace3ba6811ee1c6df52f5251c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 21, 2026.

Transparency log

Security for pytest-helm 0.1.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pytest_helm-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 21, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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