Skip to content

Commit

Permalink
fixup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 committed May 27, 2024
1 parent 5e3df03 commit f9fc7da
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 52 deletions.
67 changes: 25 additions & 42 deletions aioshutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,53 +72,46 @@
@overload
async def copy(
src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...
) -> _PathReturn:
...
) -> _PathReturn: ...

@overload
async def copy(
src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = ...
) -> _PathReturn:
...
) -> _PathReturn: ...

async def copy(src, dst, *, follow_symlinks=...):
...
async def copy(src, dst, *, follow_symlinks=...): ...

@overload
async def copy2(
src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...
) -> _PathReturn:
...
) -> _PathReturn: ...

@overload
async def copy2(
src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = ...
) -> _PathReturn:
...
) -> _PathReturn: ...

async def copy2(src, dst, *, follow_symlinks=...):
...
async def copy2(src, dst, *, follow_symlinks=...): ...

@overload
async def register_archive_format(
name: str,
function: Callable[..., object],
extra_args: Sequence[tuple[str, Any] | list[Any]],
description: str = ...,
) -> None:
...
) -> None: ...

@overload
async def register_archive_format(
name: str,
function: Callable[[str, str], object],
extra_args: None = ...,
description: str = ...,
) -> None:
...
) -> None: ...

async def register_archive_format(name, function, extra_args=..., description=...):
...
async def register_archive_format(
name, function, extra_args=..., description=...
): ...

@overload
async def register_unpack_format(
Expand All @@ -127,8 +120,7 @@ async def register_unpack_format(
function: Callable[..., object],
extra_args: Sequence[tuple[str, Any]],
description: str = ...,
) -> None:
...
) -> None: ...

@overload
async def register_unpack_format(
Expand All @@ -137,64 +129,55 @@ async def register_unpack_format(
function: Callable[[str, str], object],
extra_args: None = ...,
description: str = ...,
) -> None:
...
) -> None: ...

async def register_unpack_format(
name, extensions, function, extra_args=..., description=...
):
...
): ...

@overload
async def chown(
path: StrOrBytesPath, user: Union[str, int], group: None = ...
) -> None:
...
) -> None: ...

@overload
async def chown(
path: StrOrBytesPath, user: None = ..., *, group: Union[str, int]
) -> None:
...
) -> None: ...

@overload
async def chown(path: StrOrBytesPath, user: None, group: Union[str, int]) -> None:
...
async def chown(
path: StrOrBytesPath, user: None, group: Union[str, int]
) -> None: ...

@overload
async def chown(
path: StrOrBytesPath, user: Union[str, int], group: Union[str, int]
) -> None:
...
) -> None: ...

async def chown(path, user=..., group=...):
...
async def chown(path, user=..., group=...): ...

if sys.version_info >= (3, 8):

@overload
async def which(
cmd: _StrPathT, mode: int = ..., path: Optional[StrPath] = ...
) -> Union[str, _StrPathT, None]:
...
) -> Union[str, _StrPathT, None]: ...

@overload
async def which(
cmd: bytes, mode: int = ..., path: Optional[StrPath] = ...
) -> Optional[bytes]:
...
) -> Optional[bytes]: ...

async def which(
cmd, mode=..., path=...
) -> Union[bytes, str, StrPath, PathLike[str], None]:
...
) -> Union[bytes, str, StrPath, PathLike[str], None]: ...

else:

async def which(
cmd: _StrPathT, mode: int = ..., path: StrPath | None = ...
) -> str | _StrPathT | None:
...
) -> str | _StrPathT | None: ...


def sync_to_async(func: Callable[P, R]) -> Callable[P, Coroutine[Any, Any, R]]:
Expand Down
9 changes: 0 additions & 9 deletions tests/conftest.py

This file was deleted.

4 changes: 3 additions & 1 deletion tests/test_aioshutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import os
import stat
from pathlib import Path

import pytest
import aioshutil

pytestmark = [pytest.mark.asyncio]


async def test_copyfileobj(tmp_path: Path):
(tmp_path / "temp.txt").write_text("Hello World!", encoding="utf-8")
Expand Down

0 comments on commit f9fc7da

Please sign in to comment.