Skip to content

Commit 9406e55

Browse files
committed
Rely on zc.lockfile 2.0 with the new SimpleLockFile so that _fp is unwritten.
1 parent 2dfcddb commit 9406e55

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pytest_services/locks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import time
99

1010
import pytest
11+
import zc.lockfile
1112

1213
marker = object()
1314

@@ -53,7 +54,7 @@ def file_lock(filename, remove=True, timeout=20):
5354
:param filename: the name of the file that will be locked.
5455
5556
"""
56-
with contextlib.closing(zc.lockfile.LockFile(filename)) as lockfile:
57+
with contextlib.closing(zc.lockfile.SimpleLockFile(filename)) as lockfile:
5758
yield lockfile._fp
5859

5960

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'requests',
2020
'psutil',
2121
'pytest',
22-
'zc.lockfile',
22+
'zc.lockfile >= 2.0',
2323
]
2424

2525
PY2 = sys.version_info[0] < 3

0 commit comments

Comments
 (0)