Преглед изворни кода

Fix compatibility with testtools (#1581)

Jelmer Vernooij пре 3 месеци
родитељ
комит
11cd45caa3
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      dulwich/tests/test_object_store.py

+ 4 - 2
dulwich/tests/test_object_store.py

@@ -273,8 +273,10 @@ class ObjectStoreTests:
         self.store.add_object(blob1)
         missing_sha = b"1" * 40
 
-        with self.assertRaises(KeyError):
-            list(self.store.iterobjects_subset([blob1.id, missing_sha]))
+        self.assertRaises(
+            KeyError,
+            lambda: list(self.store.iterobjects_subset([blob1.id, missing_sha])),
+        )
 
     def test_iterobjects_subset_missing_allowed(self) -> None:
         """Test iterating with missing objects when allowed."""