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

test_file.GitFileTests.test_abort_close_removed: close lockfile before removing it

Prevents a WindowsError when calling os.remove() on the lockfile.
Tay Ray Chuan пре 14 година
родитељ
комит
25302c6026
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      dulwich/tests/test_file.py

+ 3 - 0
dulwich/tests/test_file.py

@@ -197,6 +197,9 @@ class GitFileTests(TestCase):
     def test_abort_close_removed(self):
         foo = self.path('foo')
         f = GitFile(foo, 'wb')
+
+        f._file.close()
         os.remove(foo+".lock")
+
         f.abort()
         self.assertTrue(f._closed)