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