diff --git a/setup.cfg b/setup.cfg index fc0a64189..cb5c58c5f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,8 +5,6 @@ follow_imports = silent # NOTE: If you are seeing this, feel free to create a PR to cover the below files. exclude = (?x) ^( - |tests/supervisors/test_reload.py - |tests/protocols/test_http.py |tests/protocols/test_utils.py )$ diff --git a/tests/protocols/test_http.py b/tests/protocols/test_http.py index 29c152bc1..5fe946b08 100644 --- a/tests/protocols/test_http.py +++ b/tests/protocols/test_http.py @@ -17,7 +17,7 @@ try: from uvicorn.protocols.http.httptools_impl import HttpToolsProtocol except ImportError: # pragma: nocover - HttpToolsProtocol = None + HttpToolsProtocol = None # type: ignore[misc,assignment] HTTP_PROTOCOLS = [p for p in [H11Protocol, HttpToolsProtocol] if p is not None] diff --git a/tests/supervisors/test_reload.py b/tests/supervisors/test_reload.py index 542b6b04a..44a95fb23 100644 --- a/tests/supervisors/test_reload.py +++ b/tests/supervisors/test_reload.py @@ -4,7 +4,7 @@ import sys from pathlib import Path from time import sleep -from typing import Optional, Type +from typing import List, Optional, Type import pytest @@ -16,12 +16,12 @@ try: from uvicorn.supervisors.watchfilesreload import WatchFilesReload except ImportError: # pragma: no cover - WatchFilesReload = None + WatchFilesReload = None # type: ignore[misc,assignment] try: from uvicorn.supervisors.watchgodreload import WatchGodReload except ImportError: # pragma: no cover - WatchGodReload = None + WatchGodReload = None # type: ignore[misc,assignment] def run(sockets): @@ -53,7 +53,9 @@ def _setup_reloader(self, config: Config) -> BaseReload: reloader.startup() return reloader - def _reload_tester(self, touch_soon, reloader: BaseReload, *files: Path) -> bool: + def _reload_tester( + self, touch_soon, reloader: BaseReload, *files: Path + ) -> Optional[List[Path]]: reloader.restart() if WatchFilesReload is not None and isinstance(reloader, WatchFilesReload): touch_soon(*files) @@ -267,6 +269,7 @@ def test_watchfiles_no_changes(self) -> None: from watchfiles import watch + assert isinstance(reloader, WatchFilesReload) # just so we can make rust_timeout 100ms reloader.watcher = watch( sub_dir,