Pylance typing

Fix Pylance warnings for typing
This commit is contained in:
OMEGARAZER
2022-11-30 21:12:03 -05:00
parent b438f81a43
commit 69fa1f3f09
4 changed files with 7 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ import sys
import unittest.mock
from datetime import datetime
from pathlib import Path
from typing import Optional
from typing import Optional, Type
from unittest.mock import MagicMock
import praw.models
@@ -33,7 +33,7 @@ def submission() -> MagicMock:
return test
def do_test_string_equality(result: [Path, str], expected: str) -> bool:
def do_test_string_equality(result: Path | str, expected: str) -> bool:
if platform.system() == 'Windows':
expected = FileNameFormatter._format_for_windows(expected)
return str(result).endswith(expected)
@@ -411,7 +411,7 @@ def test_windows_max_path(tmp_path: Path):
))
def test_name_submission(
test_reddit_id: str,
test_downloader: type(BaseDownloader),
test_downloader: Type[BaseDownloader],
expected_names: set[str],
reddit_instance: praw.reddit.Reddit,
):