This commit is contained in:
geekan 2024-01-10 22:02:44 +08:00
parent 8af1488613
commit 4de8fa3682
15 changed files with 33 additions and 24 deletions

View file

@ -146,7 +146,8 @@ def setup_and_teardown_git_repo(request):
# Destroy git repo at the end of the test session.
def fin():
CONTEXT.git_repo.delete_repository()
if CONTEXT.git_repo:
CONTEXT.git_repo.delete_repository()
# Register the function for destroying the environment.
request.addfinalizer(fin)