account for samples and tests folder names differences in top-level test fixture

This commit is contained in:
Ludovico Magnocavallo 2019-11-05 05:42:06 +01:00
parent 3e1a0d33c3
commit f690942264
1 changed files with 3 additions and 2 deletions

View File

@ -26,10 +26,11 @@ _BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@pytest.fixture(scope='session')
def plan():
def run_plan(tfdir):
def run_plan(testdir):
tfdir = testdir.replace('_', '-')
tf = tftest.TerraformTest(tfdir, _BASEDIR,
os.environ.get('TERRAFORM', 'terraform'))
tf.setup(extra_files=['tests/{}/terraform.tfvars'.format(tfdir)])
tf.setup(extra_files=['tests/{}/terraform.tfvars'.format(testdir)])
return tf.plan(output=True)
return run_plan