Skip to content

Commit 6b9eb6f

Browse files
Remove mypy overrides for tests.conftest (#13417)
Co-authored-by: Adam Turner <[email protected]>
1 parent 8962398 commit 6b9eb6f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ ignore_missing_imports = true
203203
[[tool.mypy.overrides]]
204204
module = [
205205
# tests/
206-
"tests.conftest",
207206
"tests.test_addnodes",
208207
"tests.test_application",
209208
"tests.test_events",

tests/conftest.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
from sphinx.testing.util import _clean_up_global_state
1717

1818
if TYPE_CHECKING:
19-
from collections.abc import Iterator
19+
from collections.abc import Callable, Iterator
20+
from typing import Any
21+
22+
from sphinx.testing.util import SphinxTestApp
2023

2124
_TESTS_ROOT = Path(__file__).resolve().parent
2225
if 'CI' in os.environ and (_TESTS_ROOT / 'roots-read-only').is_dir():
@@ -83,7 +86,7 @@ def _http_teapot(monkeypatch: pytest.MonkeyPatch) -> Iterator[None]:
8386
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418
8487
response = SimpleNamespace(status_code=418)
8588

86-
def _request(*args, **kwargs):
89+
def _request(*args: Any, **kwargs: Any) -> SimpleNamespace:
8790
return response
8891

8992
with monkeypatch.context() as m:
@@ -92,10 +95,13 @@ def _request(*args, **kwargs):
9295

9396

9497
@pytest.fixture
95-
def make_app_with_empty_project(make_app, tmp_path):
98+
def make_app_with_empty_project(
99+
make_app: Callable[..., SphinxTestApp],
100+
tmp_path: Path,
101+
) -> Callable[..., SphinxTestApp]:
96102
(tmp_path / 'conf.py').touch()
97103

98-
def _make_app(*args, **kw):
104+
def _make_app(*args: Any, **kw: Any) -> SphinxTestApp:
99105
kw.setdefault('srcdir', Path(tmp_path))
100106
return make_app(*args, **kw)
101107

0 commit comments

Comments
 (0)