From f69094226403dbfa9c62e0f4208b1af47a889be3 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Tue, 5 Nov 2019 05:42:06 +0100 Subject: [PATCH] account for samples and tests folder names differences in top-level test fixture --- tests/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index dd6c4ba6..3dea14be 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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