Skip to content

Commit

Permalink
Tests: Use pathlib for files read/write (test_determine_repo_dir_find…
Browse files Browse the repository at this point in the history
…s_existing_cookiecutter.py)
  • Loading branch information
insspb committed Jun 8, 2022
1 parent 4aac87e commit b7309ac
Showing 1 changed file with 2 additions and 1 deletion.
@@ -1,5 +1,6 @@
"""Tests around locally cached cookiecutter template repositories."""
import os
from pathlib import Path

import pytest

Expand All @@ -24,7 +25,7 @@ def cloned_cookiecutter_path(user_config_data, template):
subdir_template_path = os.path.join(cloned_template_path, 'my-dir')
if not os.path.exists(subdir_template_path):
os.mkdir(subdir_template_path)
open(os.path.join(subdir_template_path, 'cookiecutter.json'), 'w')
Path(subdir_template_path, 'cookiecutter.json').open('w') # creates file

return subdir_template_path

Expand Down

0 comments on commit b7309ac

Please sign in to comment.