Closed marshall7m closed 2 years ago
Actually, I just realized this is introducing a dependency on checksumdir
, making the module less portable. Can you find a way of using the standard library to achieve the same? I'm holding back releasing for now.
This PR fixes the issue of the caching feature having too broad of parameters that are being used for generating the caching value.
The current implementation uses the entire environment variable dictionary which includes test-level environment variables (e.g.
PYTEST_CURRENT_TEST
). This results in the cache being not used if a subsequent pytest test session were to be called with a different test that still requires the same tftest instance. To solve this, an internal_env
attribute is set within__init__
that defines the env vars that the tftest instance was initiated with. This attribute will be used instead of theenv
attribute.In addition, the file contents within
tfdir
and anytf_var_file
orextra_files
method arguments are used for generating the caching value. This means that if the Terraform configuration or anytfvars.json
files were to change, the cache will be ignored.