浏览代码

Avoid using assert.

Jelmer Vernooij 5 年之前
父节点
当前提交
a497d42988
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      dulwich/tests/test_porcelain.py

+ 3 - 3
dulwich/tests/test_porcelain.py

@@ -762,7 +762,7 @@ class DiffTreeTests(PorcelainTestCase):
         new_files = set(os.listdir(copy_path))
         new_files = set(os.listdir(copy_path))
 
 
         # Check that we have the exact same files in both repositories
         # Check that we have the exact same files in both repositories
-        assert original_files == new_files
+        self.assertEqual(original_files, new_files)
 
 
         for file in original_files:
         for file in original_files:
             if file == ".git":
             if file == ".git":
@@ -771,7 +771,7 @@ class DiffTreeTests(PorcelainTestCase):
             original_file_path = os.path.join(self.repo_path, file)
             original_file_path = os.path.join(self.repo_path, file)
             copy_file_path = os.path.join(copy_path, file)
             copy_file_path = os.path.join(copy_path, file)
 
 
-            assert os.path.isfile(copy_file_path)
+            self.assertTrue(os.path.isfile(copy_file_path))
 
 
             with open(original_file_path, "rb") as original_file:
             with open(original_file_path, "rb") as original_file:
                 original_content = original_file.read()
                 original_content = original_file.read()
@@ -779,7 +779,7 @@ class DiffTreeTests(PorcelainTestCase):
             with open(copy_file_path, "rb") as copy_file:
             with open(copy_file_path, "rb") as copy_file:
                 copy_content = copy_file.read()
                 copy_content = copy_file.read()
 
 
-            assert original_content == copy_content
+            self.assertEqual(original_content, copy_content)
 
 
 
 
 class CommitTreeTests(PorcelainTestCase):
 class CommitTreeTests(PorcelainTestCase):