Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Sep 9, 2024
1 parent e3366ed commit c974e0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion subliminal/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def list_subtitles_provider_tuple(

def list_subtitles(self, video: Video, languages: Set[Language]) -> list[Subtitle]:
"""List subtitles, multi-threaded."""
subtitles = []
subtitles: list[Subtitle] = []

# Avoid raising a ValueError with `ThreadPoolExecutor(self.max_workers)`
if self.max_workers == 0:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_handle_exception(caplog: pytest.LogCaptureFixture, err: Exception, msg:


def test_ensure_list() -> None:
ret = ensure_list(None)
ret: list = ensure_list(None)
assert isinstance(ret, list)
assert ret == []

Expand All @@ -102,7 +102,7 @@ def test_ensure_list() -> None:
assert isinstance(ret, list)
assert set(ret) == {'a', 'b'}

ret = ensure_list({'a', 'b'})
ret = ensure_list({'a', 'b'}) # type: ignore[arg-type]
assert isinstance(ret, list)
assert set(ret) == {'a', 'b'}

Expand Down Expand Up @@ -180,5 +180,5 @@ def test_merge_extend_and_ignore_unions(
defaults: list[str],
expected: set[str],
) -> None:
final = set(merge_extend_and_ignore_unions(lists, default_lists, defaults))
final = set(merge_extend_and_ignore_unions(lists, default_lists, defaults)) # type: ignore[arg-type]
assert final == expected

0 comments on commit c974e0e

Please sign in to comment.