File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,11 @@ def __init__(
6464
6565 def apply (self , plan = True ):
6666 """run terraform apply"""
67- if plan is True :
67+ if plan :
6868 plan_path = os .path .join (self .work_dir , "tfplan" )
6969 self .plan (plan_path )
7070 apply_args = self ._get_cmd_args ("apply" , plan = plan_path )
71- elif plan :
71+ else :
7272 apply_args = self ._get_cmd_args ("apply" , plan = "" )
7373 try :
7474 self ._run_cmd (apply_args )
Original file line number Diff line number Diff line change @@ -151,7 +151,8 @@ def test_tf_statejson_update_bad():
151151
152152
153153@pytest .mark .skipif (not shutil .which ("terraform" ), reason = "Terraform binary missing" )
154- def test_tf_runner (testdir , tmpdir ):
154+ @pytest .mark .parametrize ("plan" , (True , False ))
155+ def test_tf_runner (testdir , tmpdir , plan ):
155156 # ** requires network access to install plugin **
156157 with open (tmpdir .join ("resources.tf" ), "w" ) as fh :
157158 fh .write (
@@ -165,7 +166,7 @@ def test_tf_runner(testdir, tmpdir):
165166
166167 trunner = tf .TerraformRunner (tmpdir .strpath , tf_bin = shutil .which ("terraform" ))
167168 trunner .init ()
168- state = trunner .apply ()
169+ state = trunner .apply (plan = plan )
169170 assert state .get ("foo" )["content" ] == "foo!"
170171 with open (tmpdir .join ("foo.bar" )) as fh :
171172 assert fh .read () == "foo!"
You can’t perform that action at this time.
0 commit comments