diff --git a/tests/test_async_filelock.py b/tests/test_async_filelock.py index e0b150c..73eef14 100644 --- a/tests/test_async_filelock.py +++ b/tests/test_async_filelock.py @@ -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], @@ -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], @@ -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" @@ -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) @@ -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 diff --git a/tests/test_filelock.py b/tests/test_filelock.py index 6c63255..aa106e8 100644 --- a/tests/test_filelock.py +++ b/tests/test_filelock.py @@ -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 @@ -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("")