Skip to content

Commit c6c67ac

Browse files
committed
test: create empty dirs via tmp_dir.gen()
1 parent 9b6644a commit c6c67ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/dir_helpers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def _gen(self, struct, prefix=None):
5555
path = (prefix or self) / name
5656

5757
if isinstance(contents, dict):
58-
self._gen(contents, prefix=path)
58+
if not contents:
59+
makedirs(path, exist_ok=True)
60+
else:
61+
self._gen(contents, prefix=path)
5962
else:
6063
makedirs(path.parent, exist_ok=True)
6164
if is_py2 and isinstance(contents, str):

0 commit comments

Comments
 (0)