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 Feb 15, 2022
1 parent 03b542a commit 239acdf
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import os
import shutil
# import os
# import shutil
import subprocess
import tempfile

from dvc.repo import Repo as DvcRepo
from pytest_cases import fixture


@fixture(name="dvc_repo_session", scope="session")
def fix_dvc_repo_session() -> DvcRepo:
os.mkdir("./temp_test")
dvc = DvcRepo.init("./temp_test", subdir=True)
yield dvc
dvc.close()
shutil.rmtree("./temp_test")
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()


@fixture(name="dvc_repo")
Expand Down

0 comments on commit 239acdf

Please sign in to comment.