Skip to main content

kubetest

Build Status PyPI Documentation Status

Kubetest is a pytest plugin that makes it easier to manage a Kubernetes cluster within your integration tests. While you can use the Kubernetes Python client directly, this plugin provides some cluster and object management on top of that so you can spend less time setting up and tearing down tests and more time actually writing your tests. In particular, this plugin is useful for testing your Kubernetes infrastructure (e.g., ensure it deploys and behaves correctly) and for testing disaster recovery scenarios (e.g. delete a pod or deployment and inspect the aftermath).

Features:

  • Simple API for common cluster interactions.
  • Uses the Kubernetes Python client as the backend, so more complex custom actions are possible.
  • Load Kubernetes manifest YAMLs into their Kubernetes models.
  • Each test is run in its own namespace and the namespace is created and deleted automatically.
  • Detailed logging to help debug error cases.
  • Wait functions for object readiness and for object deletion.
  • Get container logs and search for expected logging output.
  • Plugin-managed RBAC permissions at test-case granularity using pytest markers.

For more information, see the kubetest documentation.

Installation

This plugin can be installed with pip

pip install kubetest

Note that the kubetest package has entrypoint hooks defined in its setup.py which allow it to be automatically made available to pytest. This means that it will run whenever pytest is run. Since kubetest expects a cluster to be set up and to be given configuration for that cluster, pytest will fail if those are not present. It is therefore recommended to only install kubetest in a virtual environment or other managed environment, such as a CI pipeline, where you can assure that cluster access and configuration are available.

Documentation

See the kubetest documentation page for details on command line usage, available fixtures and markers, and general pytest integration.

Feedback

Feedback for kubetest is greatly appreciated! If you experience any issues, find the documentation unclear, have feature requests, or just have questions about it, we'd love to know. Feel free to open an issue for any feedback you may have.

License

kubetest is released under the GPL-3.0 license.

Metadata

Release files for kubetest 0.9.5

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

Source distribution (sdist)

Source distribution for kubetest 0.9.5
File Size Uploaded Provenance
kubetest-0.9.5.tar.gz 55.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for kubetest 0.9.5
File Interpreter ABI Platform
kubetest-0.9.5-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 133.4 kB

Release files / kubetest-0.9.5.tar.gz

Download URL kubetest-0.9.5.tar.gz
Size 55.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4ea0c731c880117bf8bcc58b258d5876d5ec3f8868f88360745077c5040da195
BLAKE2b-256 checksum
How to use checksums
55e8385d49dd767db396e8408a8e5c9b22974da47787b888b82cb83e68bcdc9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Release files / kubetest-0.9.5-py2.py3-none-any.whl

Download URL kubetest-0.9.5-py2.py3-none-any.whl
Size 77.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5b13b3022ca574da936f50590ee2b94e7b1d9164e195c7d58aef709a193af19e
BLAKE2b-256 checksum
How to use checksums
df228b44e0e0d25bc6bfd84f730bce8c6351ce583445806d3133e039297acc66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Security for kubetest 0.9.5

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.

Release history Release notifications | RSS feed

This release

0.9.5 This release

2 release files No 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