Skip to content

Commit 0eb38bc

Browse files
committed
Fix test_blocking_lock_file for cygwin
This permits the longer delay in test_blocking_lock_file--which was already allowed for native Windows--on Cygwin, where it is also needed. That lets the xfail mark for Cygwin be removed. This also updates the comments to avoid implying that the need for the delay is AppVeyor-specific (it seems needed on CI and locally).
1 parent 9c7ff1e commit 0eb38bc

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

test/test_util.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from unittest import mock, skipIf
1313
from datetime import datetime
1414

15-
import pytest
1615
import ddt
1716

1817
from git.cmd import dashify
@@ -156,11 +155,6 @@ def test_lock_file(self):
156155
lock_file._obtain_lock_or_raise()
157156
lock_file._release_lock()
158157

159-
@pytest.mark.xfail(
160-
sys.platform == "cygwin",
161-
reason="Cygwin fails here for some reason, always",
162-
raises=AssertionError,
163-
)
164158
def test_blocking_lock_file(self):
165159
my_file = tempfile.mktemp()
166160
lock_file = BlockingLockFile(my_file)
@@ -173,9 +167,8 @@ def test_blocking_lock_file(self):
173167
self.assertRaises(IOError, wait_lock._obtain_lock)
174168
elapsed = time.time() - start
175169
extra_time = 0.02
176-
if is_win:
177-
# for Appveyor
178-
extra_time *= 6 # NOTE: Indeterministic failures here...
170+
if is_win or sys.platform == "cygwin":
171+
extra_time *= 6 # NOTE: Indeterministic failures without this...
179172
self.assertLess(elapsed, wait_time + extra_time)
180173

181174
def test_user_id(self):

0 commit comments

Comments
 (0)