From 57e302ed749849e89ad2f984ba71685568a2392c 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:38:22 +0100 Subject: [PATCH] [lint] run ``mypy`` on ``tests/test_addnodes.py`` (#12111) --- pyproject.toml | 1 - tests/test_addnodes.py | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 86e5e895e..4adb50f21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -217,7 +217,6 @@ disallow_any_generics = false module = [ # tests/ # "tests.conftest", - "tests.test_addnodes", "tests.test_errors", "tests.test_events", "tests.test_highlighting", diff --git a/tests/test_addnodes.py b/tests/test_addnodes.py index f90953af0..a941a6fdd 100644 --- a/tests/test_addnodes.py +++ b/tests/test_addnodes.py @@ -2,13 +2,18 @@ from __future__ import annotations +from typing import TYPE_CHECKING + import pytest from sphinx import addnodes +if TYPE_CHECKING: + from collections.abc import Generator + @pytest.fixture() -def sig_elements() -> set[type[addnodes.desc_sig_element]]: +def sig_elements() -> Generator[set[type[addnodes.desc_sig_element]], None, None]: """Fixture returning the current ``addnodes.SIG_ELEMENTS`` set.""" original = addnodes.SIG_ELEMENTS.copy() # safe copy of the current nodes yield {*addnodes.SIG_ELEMENTS} # temporary value to use during tests