Skip to content

Commit be2e599

Browse files
committed
Reformat code
1 parent 3b4af6a commit be2e599

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

terraform_pytest/main.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@
44

55
import click
66

7-
from terraform_pytest.constants import TF_REPO_PATH, TF_TEST_BINARY_PATH, TERRATEST_PROJECT_FOLDER
8-
from terraform_pytest.utils import build_test_binary, get_services, patch_repository, run_terratest_tests
7+
from terraform_pytest.constants import (
8+
TF_REPO_PATH,
9+
TF_TEST_BINARY_PATH,
10+
TERRATEST_PROJECT_FOLDER,
11+
)
12+
from terraform_pytest.utils import (
13+
build_test_binary,
14+
get_services,
15+
patch_repository,
16+
run_terratest_tests,
17+
)
918

1019
logging.basicConfig(level=logging.INFO)
1120

@@ -63,6 +72,7 @@ def clean_command():
6372
os.remove(os.path.join(TF_TEST_BINARY_PATH, file))
6473
logging.info("Done")
6574

75+
6676
@click.command(name="terratest-tests", help="Run Golang Terratest tests")
6777
def terratest_tests():
6878
logging.info(f"Running terratest tests from {TERRATEST_PROJECT_FOLDER} directory")
@@ -73,6 +83,7 @@ def terratest_tests():
7383
except Exception as e:
7484
logging.error(f"Failed to execute terratest tests: {str(e)}")
7585

86+
7687
if __name__ == "__main__":
7788
cli.add_command(build_command)
7889
cli.add_command(patch_command)

terraform_pytest/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ def execute_command(
3939

4040
try:
4141
process = subprocess.run(
42-
cmd, env=env_vars, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True
42+
cmd,
43+
env=env_vars,
44+
cwd=cwd,
45+
stdout=subprocess.PIPE,
46+
stderr=subprocess.PIPE,
47+
text=True,
4348
)
4449
return_code = process.returncode
4550
output = process.stdout + "\n" + process.stderr
@@ -156,6 +161,7 @@ def patch_repository():
156161
if stdout:
157162
logging.info(f"{patch_file} has been patched successfully.")
158163

164+
159165
def run_terratest_tests(terratest_path: str) -> Tuple[int, str]:
160166
"""
161167
Run the Golang Terratest tests for the specified project.

0 commit comments

Comments
 (0)