From b0ded2e6244bb14cc7b523b283e3816ab13fb9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Sat, 16 Mar 2024 18:29:44 +0100 Subject: [PATCH] [lint] run ``mypy`` on ``test_application.py`` (#12112) --- pyproject.toml | 1 - tests/test_application.py | 11 ++++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 50cd52b3b..86e5e895e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -218,7 +218,6 @@ module = [ # tests/ # "tests.conftest", "tests.test_addnodes", - "tests.test_application", "tests.test_errors", "tests.test_events", "tests.test_highlighting", diff --git a/tests/test_application.py b/tests/test_application.py index a0fe268fe..e39998663 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -1,9 +1,11 @@ """Test the Sphinx class.""" +from __future__ import annotations import shutil import sys from io import StringIO from pathlib import Path +from typing import TYPE_CHECKING from unittest.mock import Mock import pytest @@ -14,8 +16,15 @@ from sphinx.errors import ExtensionError from sphinx.testing.util import SphinxTestApp, strip_escseq from sphinx.util import logging +if TYPE_CHECKING: + import os -def test_instantiation(tmp_path_factory, rootdir: str, monkeypatch): + +def test_instantiation( + tmp_path_factory: pytest.TempPathFactory, + rootdir: str | os.PathLike[str] | None, + monkeypatch: pytest.MonkeyPatch, +) -> None: # Given src_dir = tmp_path_factory.getbasetemp() / 'root'