From a0c9e9a1662cea0faff0e471399cefbc4ed7b12a Mon Sep 17 00:00:00 2001 From: Antoni Baum Date: Fri, 22 Nov 2024 20:45:56 -0800 Subject: [PATCH] Lint --- src/filelock/read_write/__init__.py | 8 ++++++++ tests/conftest.py | 2 +- tests/test_read_write_filelock.py | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/filelock/read_write/__init__.py b/src/filelock/read_write/__init__.py index 5f0c4d2..f2fc5ff 100644 --- a/src/filelock/read_write/__init__.py +++ b/src/filelock/read_write/__init__.py @@ -1,3 +1,11 @@ +""" +Read/write file lock. + +.. autodata:: filelock.__version__ + :no-value: + +""" + from __future__ import annotations from typing import TYPE_CHECKING diff --git a/tests/conftest.py b/tests/conftest.py index f94da15..50c0cef 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,7 @@ import sys import threading from types import TracebackType -from typing import Tuple, Type, Union +from typing import Tuple, Type, Union, Callable import pytest diff --git a/tests/test_read_write_filelock.py b/tests/test_read_write_filelock.py index 61173b4..2182d04 100644 --- a/tests/test_read_write_filelock.py +++ b/tests/test_read_write_filelock.py @@ -2,6 +2,7 @@ import threading import time +from pathlib import Path from queue import Queue import pytest @@ -10,10 +11,11 @@ BaseReadWriteFileLockWrapper, ReadWriteFileLockWrapper, ReadWriteMode, + has_read_write_lock, ) -@pytest.mark.skipif(not _has_read_write_lock, reason="ReadWriteFileLock is not available") +@pytest.mark.skipif(not has_read_write_lock, reason="ReadWriteFileLock is not available") @pytest.mark.parametrize("lock_wrapper_type", [ReadWriteFileLockWrapper]) def test_threaded_read_write_lock( lock_wrapper_type: type[BaseReadWriteFileLockWrapper], tmp_path: Path, ex_thread_cls: threading.Thread @@ -79,7 +81,7 @@ def write_thread_work() -> None: should_proceed_event.set() - for thread in write_threads: + for _ in write_threads: is_ready_writers_queue.get() with num_writers_lock: assert num_writers in {0, 1}