Skip to content

Commit bc4cf60

Browse files
committed
[test/parser_] Fix dir create on clean system
1 parent fe9d562 commit bc4cf60

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/test_parser_json.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ def setUp(self):
2121
self.json_reader = dict_parser.DictReader(show_warnings=False)
2222

2323
dir_name = os.path.basename(os.path.splitext(__file__)[0])
24-
tmp_dir_path = os.path.join(tempfile.gettempdir(), "odml_test", dir_name)
24+
tmp_base_path = os.path.join(tempfile.gettempdir(), "odml_test")
25+
if not os.path.exists(tmp_base_path):
26+
os.mkdir(tmp_base_path)
2527

28+
tmp_dir_path = os.path.join(tmp_base_path, dir_name)
2629
if not os.path.exists(tmp_dir_path):
2730
os.mkdir(tmp_dir_path)
2831

test/test_parser_yaml.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ def setUp(self):
2121
self.yaml_reader = dict_parser.DictReader(show_warnings=False)
2222

2323
dir_name = os.path.basename(os.path.splitext(__file__)[0])
24-
tmp_dir_path = os.path.join(tempfile.gettempdir(), "odml_test", dir_name)
24+
tmp_base_path = os.path.join(tempfile.gettempdir(), "odml_test")
25+
if not os.path.exists(tmp_base_path):
26+
os.mkdir(tmp_base_path)
2527

28+
tmp_dir_path = os.path.join(tmp_base_path, dir_name)
2629
if not os.path.exists(tmp_dir_path):
2730
os.mkdir(tmp_dir_path)
2831

0 commit comments

Comments
 (0)