aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/filelock/ut/lib
diff options
context:
space:
mode:
authorNikita Slyusarev <nslus@yandex-team.com>2022-02-10 16:46:53 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:53 +0300
commit469afdc4e2587bf62ecdd096b75a0baa444c4012 (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /library/python/filelock/ut/lib
parentcd77cecfc03a3eaf87816af28a33067c4f0cdb59 (diff)
downloadydb-469afdc4e2587bf62ecdd096b75a0baa444c4012.tar.gz
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 2 of 2.
Diffstat (limited to 'library/python/filelock/ut/lib')
-rw-r--r--library/python/filelock/ut/lib/test_filelock.py18
-rw-r--r--library/python/filelock/ut/lib/ya.make2
2 files changed, 10 insertions, 10 deletions
diff --git a/library/python/filelock/ut/lib/test_filelock.py b/library/python/filelock/ut/lib/test_filelock.py
index 5c2e0181ff7..1b11d891231 100644
--- a/library/python/filelock/ut/lib/test_filelock.py
+++ b/library/python/filelock/ut/lib/test_filelock.py
@@ -8,13 +8,13 @@ import threading
import library.python.filelock
-def _acquire_lock(lock_path, out_file_path):
+def _acquire_lock(lock_path, out_file_path):
with library.python.filelock.FileLock(lock_path):
- with open(out_file_path, "a") as out:
- out.write("{}:{}\n".format(os.getpid(), time.time()))
- time.sleep(2)
-
-
+ with open(out_file_path, "a") as out:
+ out.write("{}:{}\n".format(os.getpid(), time.time()))
+ time.sleep(2)
+
+
def test_filelock():
temp_dir = tempfile.mkdtemp()
lock_path = os.path.join(temp_dir, "file.lock")
@@ -46,12 +46,12 @@ def test_filelock():
time2 = times.pop()
assert int(time1) - int(time2) >= 2
time1 = time2
-
-
+
+
def test_filelock_init_acquired():
temp_dir = tempfile.mkdtemp()
lock_path = os.path.join(temp_dir, "file.lock")
-
+
with library.python.filelock.FileLock(lock_path):
sublock = library.python.filelock.FileLock(lock_path)
del sublock
diff --git a/library/python/filelock/ut/lib/ya.make b/library/python/filelock/ut/lib/ya.make
index 291f8a32bae..f3f9da5a67e 100644
--- a/library/python/filelock/ut/lib/ya.make
+++ b/library/python/filelock/ut/lib/ya.make
@@ -2,7 +2,7 @@ OWNER(g:yatool)
PY23_LIBRARY()
-TEST_SRCS(test_filelock.py)
+TEST_SRCS(test_filelock.py)
PEERDIR(
library/python/filelock