tftest
Simple Terraform test helper
Decision gist · record as of 2026-08-14
Yes. tftest is actively maintained, has no external runtime dependencies, carries a permissive license, and solves a clear problem for teams testing Terraform infrastructure-as-code. The caching feature and structured output parsing add practical value. Install it if you write Python tests for Terraform modules.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Terraform binary must be installed and available on the system PATH; Terraform 0.12 or later is required.
- Low install friction with no runtime dependencies.
- Actively maintained as of 2026-06-29 with a recent release cycle.
License · maintenance · safety
permissive license (permissive) — Licensed under Apache Software License (permissive), allowing use in commercial and proprietary projects without significant restriction.
last release 2026-06-29 (46 days) · last repo commit 2026-06-29 · 223 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 116,499 downloads/mo, #12,200 on PyPI
Alternatives
Verify before relying
pip install tftest
import tftest
tf = tftest.TerraformTest('plan', 'path/to/terraform')
tf.setup()
plan = tf.plan(output=True)- Whether caching feature works reliably across different Terraform versions and file system states.
- Performance characteristics when testing large or complex Terraform modules.
- Compatibility with recent Terraform versions beyond 0.12.
What it is and what it does
tftest is a Python wrapper around the Terraform command-line tool designed to simplify testing Terraform modules. It provides a programmatic interface to run Terraform operations (init, plan, apply, destroy) and parse their outputs, making it easier to write unit tests that validate Terraform configurations without manual command execution.
The package supports two testing approaches: lightweight tests using only init and plan to verify syntax and resource counts, or full integration tests that run the complete apply/output/destroy cycle and validate actual infrastructure state. It includes a caching mechanism to speed up repeated test runs by storing and reusing command outputs based on file content hashes, and provides convenience classes to access plan variables, outputs, resources, and modules in a structured way.
Use it for
- Validate Terraform module syntax and resource definitions in CI/CD pipelines before deployment.
- Test that Terraform configurations produce the expected number and type of resources via plan output inspection.
- Verify Terraform outputs and state file contents after applying configurations to actual infrastructure.
- Cache expensive Terraform operations during test development to reduce iteration time.
- Programmatically inspect plan resources and module structure from Python test code.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
tftest is actively maintained, has no external runtime dependencies, carries a permissive license, and solves a clear problem for teams testing Terraform infrastructure-as-code. The caching feature and structured output parsing add practical value. Install it if you write Python tests for Terraform modules.
Install
tftest on PyPI
Before you install
Low install friction with no runtime dependencies. Actively maintained as of 2026-06-29 with a recent release cycle.
Terraform binary must be installed and available on the system PATH; Terraform 0.12 or later is required.
License in practice
Licensed under Apache Software License (permissive), allowing use in commercial and proprietary projects without significant restriction.
Quickstart
pip install tftest
import tftest
tf = tftest.TerraformTest('plan', 'path/to/terraform')
tf.setup()
plan = tf.plan(output=True)
Verify before relying
- Whether caching feature works reliably across different Terraform versions and file system states.
- Performance characteristics when testing large or complex Terraform modules.
- Compatibility with recent Terraform versions beyond 0.12.
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 46 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 116,499 / month, #12,200 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: tftest-1.8.8-py3-none-any.whl
Tags
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 › “terraform testing python”
- tftestWraps the Terraform executable to facilitate testing Terraform…
- terraform-localA wrapper script that runs Terraform against LocalStack by…
- terraform-complianceterraform-compliance is a BDD-based test framework that validates…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
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.
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.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
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.
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.
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.
See also python-terraform · tfparse · terraform-compliance · terraform-local · executable-application · pytest-docker · pytest-lazy-fixture · mocksftp · testgres · pytest-lazy-fixtures