diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 02c6f58..acaae72 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -23,6 +23,17 @@ def dynamic_metadata() -> List[str]: @pytest.fixture def root_folder(tmp_path: Path) -> str: + """ + Returns a "virtual" root folder with a "virtual" git config + + Git config comes from the tests/configs/gitconfig file + + This is necessary to ensure tests run always with the same git configuration file, + to avoid variability coming from: + - tests ran on plain files (not linked to any git repo) + - tests ran on a repository fork (e.g myuser/hatch-openzim) + - tests ran with a different remote (nothing forces main remote to be named origin) + """ git_folder = tmp_path / ".git" git_folder.mkdir() shutil.copy(