Skip to content

Commit

Permalink
fix: used tempfile.TemporaryDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahCFisher authored and shaunc committed Mar 3, 2022
1 parent 051704b commit 0242172
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
from kedro_dvc.create_sample_project import create_sample_project


@fixture(name="dvc_repo_session", scope="session")
def fix_dvc_repo_session() -> DvcRepo:
with tempfile.TemporaryDirectory() as dir:
# os.mkdir("./temp_test")
subprocess.check_call(["git", "init"], cwd=dir)
dvc = DvcRepo.init(dir, subdir=True)
yield dvc
dvc.close()


@contextlib.contextmanager
def to_tmp_dir() -> Iterator[pathlib.Path]:
"""
Expand Down

0 comments on commit 0242172

Please sign in to comment.