From ae6b08edeabe63ce80e494a1cf194fddf6df9594 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 8 Nov 2022 14:04:38 +0100 Subject: [PATCH] Fix test_get_repo If the test needs a repository, it should create it for itself. --- tests/test_git_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_git_utils.py b/tests/test_git_utils.py index 397c1b8..d4bca36 100644 --- a/tests/test_git_utils.py +++ b/tests/test_git_utils.py @@ -55,13 +55,13 @@ def init_repo_diff( return git_repo -def test_get_repo() -> None: +def test_get_repo(tmp_path: Path) -> None: """Find git repository.""" - curr_dir = Path(__file__).parent - repo = get_repo(curr_dir) + Repo.init(tmp_path) + repo = get_repo(tmp_path) assert repo.working_dir is not None assert isinstance(repo, Repo) - assert Path(repo.working_dir).stem == "databooks" + assert Path(repo.working_dir).stem == "test_get_repo0" def test_get_repo_missing(tmp_path: Path) -> None: