Skip to content

Commit

Permalink
Really make sure files exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ghickman committed Dec 24, 2015
1 parent 2177969 commit 8e42f0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ def files(request):
with open(os.path.join(PATH, 'file_list'), 'r') as f:
paths = f.readlines()

if not os.path.exists(FILES):
os.makedirs(FILES)
full_paths = list(map(lambda p: os.path.join(FILES, p.strip()), paths))
for path in full_paths:
with open(path, 'w') as f:
f.write('')
open(path, 'a').close()

# TODO: write the same files to subfolder

Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def build_path(path):
if not os.path.exists(path):
os.mkdir(path)
os.makedirs(path)

return path

Expand Down

0 comments on commit 8e42f0e

Please sign in to comment.