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

Remove racy check that relies on mtime changing between writes.

Jelmer Vernooij пре 8 година
родитељ
комит
b5d7ab9610
2 измењених фајлова са 7 додато и 1 уклоњено
  1. 5 0
      NEWS
  2. 2 1
      dulwich/tests/test_index.py

+ 5 - 0
NEWS

@@ -1,5 +1,10 @@
 0.16.3	UNRELEASED
 
+ TEST FIXES
+
+  * Remove racy check that relies on clock time changing between writes.
+   (Jelmer Vernooij)
+
 0.16.2	2016-01-14
 
  IMPROVEMENTS

+ 2 - 1
dulwich/tests/test_index.py

@@ -405,7 +405,8 @@ class BuildIndexTests(TestCase):
             build_index_from_tree(repo.path, repo.index_path(),
                                   repo.object_store, tree.id)
             sync()
-            self.assertNotEqual(mtime, os.stat(filea_path).st_mtime)
+            with open(filea_path, 'rb') as fh:
+                self.assertEqual(b'file a', fh.read())
 
 
     @skipIf(not getattr(os, 'symlink', None), 'Requires symlink support')