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 Jul 8, 2024
1 parent fc1ba1e commit 6d4657c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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
4 changes: 2 additions & 2 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

0 comments on commit 6d4657c

Please sign in to comment.