From 997d7a995df91b4c51027afda34592948a19477d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 2 Nov 2023 16:24:28 -0700 Subject: [PATCH] cleanup inside GitTemporaryDirectory --- tests/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: