Parcourir la source

Add cleanup for unclosed Repo objects in test_index

Jelmer Vernooij il y a 3 semaines
Parent
commit
5f8d973948
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      tests/compat/test_index.py

+ 2 - 0
tests/compat/test_index.py

@@ -1063,6 +1063,7 @@ class SparseIndexCompatTestCase(CompatTestCase):
 
 
         # Create a tree structure using Dulwich
         # Create a tree structure using Dulwich
         repo = Repo(repo_path)
         repo = Repo(repo_path)
+        self.addCleanup(repo.close)
 
 
         # Create blobs
         # Create blobs
         blob1 = Blob()
         blob1 = Blob()
@@ -1171,6 +1172,7 @@ class SparseIndexCompatTestCase(CompatTestCase):
         if idx.is_sparse():
         if idx.is_sparse():
             # Expand the index
             # Expand the index
             repo = Repo(repo_path)
             repo = Repo(repo_path)
+            self.addCleanup(repo.close)
             idx.ensure_full_index(repo.object_store)
             idx.ensure_full_index(repo.object_store)
 
 
             # Should no longer be sparse
             # Should no longer be sparse