Skip to content

Commit

Permalink
bugfix: use os.makedirs instead of os.mkdir
Browse files Browse the repository at this point in the history
This commit updates riscof/framework/test to use os.makedirs(...,
exists_ok=True) which prevents exceptions being raised when trying to
rerun certain CLI commands that don't expect directories to already
exist.
  • Loading branch information
shareefj committed Feb 9, 2024
1 parent 108fa2d commit 5db45ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions riscof/framework/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,9 @@ def run_tests(dut, base, ispec, pspec, work_dir, cntr_args):
dut_test_list[entry] = deepcopy(node)
base_test_list[entry] = deepcopy(node)
dut_test_list[entry]['work_dir'] = os.path.join(node['work_dir'],'dut')
os.mkdir(dut_test_list[entry]['work_dir'])
os.makedirs(dut_test_list[entry]['work_dir'], exist_ok=True)
base_test_list[entry]['work_dir'] = os.path.join(node['work_dir'],'ref')
os.mkdir(base_test_list[entry]['work_dir'])
os.makedirs(base_test_list[entry]['work_dir'], exist_ok=True)
results = []
if cntr_args[2]:
logger.info("Running Tests on DUT.")
Expand Down

0 comments on commit 5db45ae

Please sign in to comment.