Simple, ergonomic Helm manifest fixtures for pytest.
Project description
pytest-helm
pytest-helm makes Helm chart testing in pytest simple and repeatable.
It runs a helm template command, loads your manifest, and then allows you to make simple assertions about it's shape/contents.
Quickstart
Install:
uv add pytest-helm
Create tests/conftest.py:
from pytest_helm import manifest_fixture
default_manifest = manifest_fixture(
"default_manifest",
["helm", "template", ".", "-f", "values.yaml"],
)
multi_tenant_manifest = manifest_fixture(
"multi_tenant_manifest",
["helm", "template", ".", "-f", "multi-tenant-values.yaml"],
)
Write tests:
def test_it_works(default_manifest):
cfg_map = default_manifest["ConfigMap"]["example-config"]
assert cfg_map.data.AWS_DEFAULT_REGION == "us-east-2"
def test_it_works_for_multi_tenants(multi_tenant_manifest):
cfg_map = multi_tenant_manifest["ConfigMap"]["example"]
assert cfg_map.data.AWS_DEFAULT_REGION == "us-east-2"
Fixture Usage
manifest_fixture(
name: str, # The name of the fixture
command: Sequence[str], # Command list to render manifests
*,
on_duplicate: Literal["error", "overwrite"] = "error", # Whether to raise an error on duplicate manifests
scope: Literal["session"] = "session", # Currently session only, execute fixtures once per test sess
)
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_helm-0.1.0.tar.gz.
File metadata
- Download URL: pytest_helm-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6e74f22d66befce1eaa5c98bdf36c9e09d06cf4422264101f24a8092ae3df73
|
|
| MD5 |
f3cfa7fb90f98ebf3718be3da9dfe277
|
|
| BLAKE2b-256 |
6fb1fd9353625add5ab4605a39e6ec91123022134cfe67119befe3d1c0639883
|
Provenance
The following attestation bundles were made for pytest_helm-0.1.0.tar.gz:
Publisher:
publish.yml on thomasv314/pytest-helm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_helm-0.1.0.tar.gz -
Subject digest:
f6e74f22d66befce1eaa5c98bdf36c9e09d06cf4422264101f24a8092ae3df73 - Sigstore transparency entry: 975083658
- Sigstore integration time:
-
Permalink:
thomasv314/pytest-helm@06dfdbe4d8d29774369c2b00fceb646f3ff923c0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/thomasv314
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@06dfdbe4d8d29774369c2b00fceb646f3ff923c0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytest_helm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pytest_helm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc8e7c8e891a23c5fa5e72ac20898d759d58090326564ef7daa8f745acef8a02
|
|
| MD5 |
bb098285f8a508fc863a044d298b43bf
|
|
| BLAKE2b-256 |
8f395930d49bc63eabc3b24a0ac0c86df57bbc3991c81d60ab61561ed80cbb77
|
Provenance
The following attestation bundles were made for pytest_helm-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on thomasv314/pytest-helm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_helm-0.1.0-py3-none-any.whl -
Subject digest:
cc8e7c8e891a23c5fa5e72ac20898d759d58090326564ef7daa8f745acef8a02 - Sigstore transparency entry: 975083659
- Sigstore integration time:
-
Permalink:
thomasv314/pytest-helm@06dfdbe4d8d29774369c2b00fceb646f3ff923c0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/thomasv314
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@06dfdbe4d8d29774369c2b00fceb646f3ff923c0 -
Trigger Event:
push
-
Statement type: