Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Yard1 authored Nov 23, 2024
1 parent 978b128 commit a0c9e9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/filelock/read_write/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""
Read/write file lock.
.. autodata:: filelock.__version__
:no-value:
"""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions tests/test_read_write_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import threading
import time
from pathlib import Path
from queue import Queue

import pytest
Expand All @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit a0c9e9a

Please sign in to comment.