Silence FAST tests warnings

- Fix pytest PytestUnraisableExceptionWarning
- Remove incorrect print
- Use tfvars for some examples in READMEs
This commit is contained in:
Julio Castillo 2023-08-28 18:35:47 +02:00
parent c63884d52e
commit 804e7c961e
2 changed files with 8 additions and 3 deletions

View File

@ -145,7 +145,7 @@ The first set of default tags cannot be overridden and defines the following key
The second set is optional and allows defining a custom tag hierarchy, including IAM bindings that can refer to specific identities, or to the internally defined automation service accounts via their names, like in the following example:
```hcl
```tfvars
tags = {
my-custom-tag = {
values = {
@ -258,7 +258,7 @@ classDiagram
This is an example that shows how to populate the relevant variables.
```hcl
```tfvars
tenants = {
tn0 = {
admin_group_email = "tn-0-admins@tenant.example.org"

View File

@ -133,6 +133,12 @@ def plan_summary(module_path, basedir, tf_var_files=None, extra_files=None,
# extract planned outputs
outputs = plan.get('planned_values', {}).get('outputs', {})
# force the destruction of the tftest object, otherwise pytest
# will complain about unraisable exceptions caused by the context
# manager deleting temporary files, including the extra_files that
# tftest tries to remove on cleanup
del tf
return PlanSummary(values, dict(counts), outputs)
@ -148,7 +154,6 @@ def plan_summary_fixture(request):
**tf_vars):
if basedir is None:
basedir = Path(request.fspath).parent
print(f"{basedir=}")
return plan_summary(module_path=module_path, basedir=basedir,
tf_var_files=tf_var_files, extra_files=extra_files,
**tf_vars)