diff options
| author | Nikita Slyusarev <[email protected]> | 2022-02-10 16:46:53 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:53 +0300 |
| commit | 469afdc4e2587bf62ecdd096b75a0baa444c4012 (patch) | |
| tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/python/filelock/ut/lib/test_filelock.py | |
| parent | cd77cecfc03a3eaf87816af28a33067c4f0cdb59 (diff) | |
Restoring authorship annotation for Nikita Slyusarev <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/python/filelock/ut/lib/test_filelock.py')
| -rw-r--r-- | library/python/filelock/ut/lib/test_filelock.py | 18 |
1 files changed, 9 insertions, 9 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 |
