File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -286,8 +286,9 @@ def test_vm_lifecycle(vm_dir):
286286def test_valid_config (vm_dir ):
287287 v = vagrant .Vagrant (vm_dir )
288288 v .up ()
289- output = v .validate ()
290- assert output .strip () == "Vagrantfile validated successfully."
289+ validation = v .validate (vm_dir )
290+
291+ assert validation .returncode == 0
291292
292293
293294def test_vm_config (vm_dir ):
Original file line number Diff line number Diff line change @@ -876,12 +876,19 @@ def plugin_list(self):
876876 output = self ._run_vagrant_command (["plugin" , "list" , "--machine-readable" ])
877877 return self ._parse_plugin_list (output )
878878
879- def validate (self ):
879+ def validate (self , directory ):
880880 """
881881 This command validates present Vagrantfile.
882882 """
883- output = self ._run_vagrant_command (["validate" ])
884- return output
883+ validate = subprocess .run (
884+ ["vagrant" , "validate" ],
885+ cwd = directory ,
886+ check = True ,
887+ stdout = subprocess .PIPE ,
888+ stderr = subprocess .PIPE ,
889+ )
890+
891+ return validate
885892
886893 def _parse_plugin_list (self , output ):
887894 """
You can’t perform that action at this time.
0 commit comments