Skip to content

Commit

Permalink
Make modules and resources optional in tftest directive
Browse files Browse the repository at this point in the history
  • Loading branch information
juliocc committed Aug 8, 2024
1 parent 91a1424 commit 5582b95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/examples/test_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ def test_example(plan_validator, example):
counts = summary.counts
num_modules, num_resources = counts['modules'], counts['resources']

if expected_modules := int(directive.kwargs['modules']):
if expected_modules := directive.kwargs.get('modules'):
expected_modules = int(expected_modules)
assert expected_modules == num_modules, 'wrong number of modules'
if expected_resources := int(directive.kwargs['resources']):
if expected_resources := directive.kwargs.get('resources'):
expected_resources = int(expected_resources)
assert expected_resources == num_resources, 'wrong number of resources'

# TODO(jccb): this should probably be done in check_documentation
Expand Down

0 comments on commit 5582b95

Please sign in to comment.