Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 2, 2024
1 parent 8893a84 commit ca262a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions tests/test_async_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock])
@pytest.mark.parametrize("path_type", [str, PurePath, Path])
@pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_simple(
lock_type: type[BaseAsyncFileLock],
path_type: type[str | Path],
Expand Down Expand Up @@ -43,7 +43,7 @@ async def test_simple(
@pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock])
@pytest.mark.parametrize("path_type", [str, PurePath, Path])
@pytest.mark.parametrize("filename", ["a", "new/b", "new2/new3/c"])
@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_acquire(
lock_type: type[BaseAsyncFileLock],
path_type: type[str | Path],
Expand Down Expand Up @@ -73,7 +73,7 @@ async def test_acquire(


@pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock])
@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_non_blocking(lock_type: type[BaseAsyncFileLock], tmp_path: Path) -> None:
# raises Timeout error when the lock cannot be acquired
lock_path = tmp_path / "a"
Expand Down Expand Up @@ -147,7 +147,7 @@ async def test_non_blocking(lock_type: type[BaseAsyncFileLock], tmp_path: Path)

@pytest.mark.parametrize("lock_type", [AsyncFileLock, AsyncSoftFileLock])
@pytest.mark.parametrize("thread_local", [True, False])
@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_non_executor(lock_type: type[BaseAsyncFileLock], thread_local: bool, tmp_path: Path) -> None:
lock_path = tmp_path / "a"
lock = lock_type(str(lock_path), thread_local=thread_local, run_in_executor=False)
Expand All @@ -157,7 +157,7 @@ async def test_non_executor(lock_type: type[BaseAsyncFileLock], thread_local: bo
assert not lock.is_locked


@pytest.mark.asyncio()
@pytest.mark.asyncio
async def test_coroutine_function(tmp_path: Path) -> None:
acquired = released = False

Expand Down
8 changes: 4 additions & 4 deletions tests/test_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def make_ro(path: Path) -> Iterator[None]:
path.chmod(path.stat().st_mode | write)


@pytest.fixture()
@pytest.fixture
def tmp_path_ro(tmp_path: Path) -> Iterator[Path]:
with make_ro(tmp_path):
yield tmp_path
Expand All @@ -81,7 +81,7 @@ def test_ro_folder(lock_type: type[BaseFileLock], tmp_path_ro: Path) -> None:
lock.acquire()


@pytest.fixture()
@pytest.fixture
def tmp_file_ro(tmp_path: Path) -> Iterator[Path]:
filename = tmp_path / "a"
filename.write_text("")
Expand Down Expand Up @@ -680,7 +680,7 @@ def test_lock_can_be_non_thread_local(

def test_subclass_compatibility(tmp_path: Path) -> None:
class MyFileLock(FileLock):
def __init__( # noqa: PLR0913 Too many arguments to function call (6 > 5)
def __init__(
self,
lock_file: str | os.PathLike[str],
timeout: float = -1,
Expand All @@ -696,7 +696,7 @@ def __init__( # noqa: PLR0913 Too many arguments to function call (6 > 5)
MyFileLock(str(lock_path), my_param=1)

class MySoftFileLock(SoftFileLock):
def __init__( # noqa: PLR0913 Too many arguments to function call (6 > 5)
def __init__(
self,
lock_file: str | os.PathLike[str],
timeout: float = -1,
Expand Down

0 comments on commit ca262a9

Please sign in to comment.