Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#354)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Sep 7, 2024
1 parent 067b651 commit 7397dd7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ repos:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.1.3"
rev: "2.2.1"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.12.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.0"
rev: "v0.6.3"
hooks:
- id: ruff-format
- id: ruff
Expand Down
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 7397dd7

Please sign in to comment.