aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/filelock/ut
diff options
context:
space:
mode:
authorNikita Slyusarev <nslus@yandex-team.com>2022-02-10 16:46:52 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:52 +0300
commitcd77cecfc03a3eaf87816af28a33067c4f0cdb59 (patch)
tree1308e0bae862d52e0020d881fe758080437fe389 /library/python/filelock/ut
parentcdae02d225fb5b3afbb28990e79a7ac6c9125327 (diff)
downloadydb-cd77cecfc03a3eaf87816af28a33067c4f0cdb59.tar.gz
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'library/python/filelock/ut')
-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 1b11d89123..5c2e0181ff 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 f3f9da5a67..291f8a32ba 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