소스 검색

Fix compatibility with testtools

Jelmer Vernooij 3 달 전
부모
커밋
eda9708f06
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."""