Skip to main content
pytest-terraform-fixture
================

🚀 Description
-----------

`--terraform-dir` で指定したディレクトリにある Terraform で作成されるリソースを動的に pytest の fixture として自動で定義してくれる pluginです

🚀 Install
-------

github から引っ張ってきて。

```sh
pip install pytest-terraform-fixture
```


🚀 Usage
-----

Terraform で作成したいリソースを記述する (ここでは `instance_a` のリソースを定義したとする)
```terraform
provider "nifcloud" {
access_key = "xxxxx"
secret_key = "yyyyy"
region = "jp-east-1"
endpoint = "jp-east-1.conputing.api.nifcloud.com"
}

resource "nifcloud_instance" "instance_a" {
instance_id = "hogehogea"
image_id = "89"
key_name = "ssh_key"
instance_type = "large"
description = "pytest-terraform"
availability_zone = "east-11"
disable_api_termination = "false"
ip_type = "none"
}
```

pytest で `instance_a` をリソースを使うテストを作成します (自動的に `instance_a` をfixutreとして定義してくれる)

```python
import pytest
from python_terraform import Terraform

def test_terraform_fixture(instance_a):
# instance_a を作成するテスト
assert True
```

後は、 `*.tf` のディレクトリを指定して実行
```sh
pytest --terraform-dir={実施したい *.tf をもつディレクトリ}
```

🚀 Requirements
------------

このプロジェクトを実行するには以下が必要です:

* [python](https://www.python.org/) 3.4.+
* [terraform](https://www.terraform.io) 0.11.+

🚀 Contributing
------------

PR歓迎してます

🚀 Support and Migration
---------------------

特に無し

🚀 License
-------

- [MIT License](http://petitviolet.mit-license.org/)

Metadata

Release files for pytest-terraform-fixture 0.1.2

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-terraform-fixture 0.1.2
File Size Uploaded
pytest-terraform-fixture-0.1.2.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-terraform-fixture 0.1.2
File Interpreter ABI Platform
pytest_terraform_fixture-0.1.2-py3.6.egg Legacy Egg format - - Details

Total release size: 10.3 kB

Release files / pytest-terraform-fixture-0.1.2.tar.gz

Download URL pytest-terraform-fixture-0.1.2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9349947173bb96f54b9b9f15f6be6d38ef51f52dfa7deabc66e4d6663e486a0d
BLAKE2b-256 checksum
How to use checksums
dac93ffd69cd3135127a01feb4b3538bab7de135d3120a6a5a6fde65c1d571bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.12.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release files / pytest_terraform_fixture-0.1.2-py3.6.egg

Download URL pytest_terraform_fixture-0.1.2-py3.6.egg
Size 6.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
7edfc00257874f5a364f0b363f146f7ff1c2798108ce7fd1fbc4be6d4def6397
BLAKE2b-256 checksum
How to use checksums
7c732fcee367e71b6fd18603105710098ffd9ea809c890fb4187e7a9d7014ad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.12.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

1 release file

0.1.0

2 release files

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