diff --git a/tests/utils.py b/tests/utils.py index 06a17abfbbb..d6146af47f7 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -38,9 +38,13 @@ def __exit__(self, exc_type, exc_val, exc_tb): class GitTemporaryDirectory(ChdirTemporaryDirectory): def __enter__(self): res = super().__enter__() - make_repo() + self.repo = make_repo() return res + def __exit__(self, exc_type, exc_val, exc_tb): + del self.repo + super().__exit__(exc_type, exc_val, exc_tb) + def make_repo(path=None): if not path: