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
  • Loading branch information
pre-commit-ci[bot] committed Feb 1, 2024
1 parent 28aa0a3 commit 5f520d9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
12 changes: 4 additions & 8 deletions scripts/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def run_checks(
regenerate_examples: Literal[True],
typeshed_dir: Path,
download_typeshed: Literal[False] = ...,
) -> None:
...
) -> None: ...


@overload
Expand All @@ -25,8 +24,7 @@ def run_checks(
regenerate_examples: Literal[True],
download_typeshed: Literal[True],
typeshed_dir: None = ...,
) -> None:
...
) -> None: ...


@overload
Expand All @@ -35,8 +33,7 @@ def run_checks(
regenerate_examples: Literal[False],
download_typeshed: Literal[False] = ...,
typeshed_dir: None = ...,
) -> None:
...
) -> None: ...


@overload
Expand All @@ -45,8 +42,7 @@ def run_checks(
regenerate_examples: bool = ...,
typeshed_dir: Path | None = ...,
download_typeshed: bool = ...,
) -> None:
...
) -> None: ...


def run_checks(
Expand Down
6 changes: 2 additions & 4 deletions src/typeshed_stats/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,11 @@ def stats_to_csv(stats: Sequence[PackageInfo | FileInfo]) -> str:


@typing.overload
def _stats_from_csv(data: str, cls: type[PackageInfo]) -> list[PackageInfo]:
...
def _stats_from_csv(data: str, cls: type[PackageInfo]) -> list[PackageInfo]: ...


@typing.overload
def _stats_from_csv(data: str, cls: type[FileInfo]) -> list[FileInfo]:
...
def _stats_from_csv(data: str, cls: type[FileInfo]) -> list[FileInfo]: ...


def _stats_from_csv(
Expand Down
13 changes: 8 additions & 5 deletions tests/test__cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,14 @@ def test_KeyboardInterrupt_caught(
args: list[str], typeshed: Path, capsys: pytest.CaptureFixture[str]
) -> None:
args += ["--log", "CRITICAL"]
with pytest.raises(SystemExit) as exc_info, mock.patch.object(
typeshed_stats.gather,
"gather_stats_on_package",
autospec=True,
side_effect=KeyboardInterrupt(),
with (
pytest.raises(SystemExit) as exc_info,
mock.patch.object(
typeshed_stats.gather,
"gather_stats_on_package",
autospec=True,
side_effect=KeyboardInterrupt(),
),
):
main(args)

Expand Down
13 changes: 8 additions & 5 deletions tests/test_gather.py
Original file line number Diff line number Diff line change
Expand Up @@ -1225,10 +1225,13 @@ def test_basic_sanity_checks(subtests: SubTests) -> None:


def test_exceptions_bubble_up(typeshed: Path) -> None:
with pytest.raises(KeyError), mock.patch.object(
typeshed_stats.gather,
"gather_stats_on_package",
autospec=True,
side_effect=KeyError,
with (
pytest.raises(KeyError),
mock.patch.object(
typeshed_stats.gather,
"gather_stats_on_package",
autospec=True,
side_effect=KeyError,
),
):
gather_stats_on_multiple_packages(typeshed_dir=typeshed)

0 comments on commit 5f520d9

Please sign in to comment.