Narrow `Generator[T, None, None] types to Iterator[T]` (#12241)

This commit is contained in:
Adam Turner
2024-04-09 03:26:44 +01:00
committed by GitHub
parent 413e740dca
commit 3421e5382a
20 changed files with 61 additions and 54 deletions

View File

@@ -9,11 +9,11 @@ import pytest
from sphinx import addnodes
if TYPE_CHECKING:
from collections.abc import Generator
from collections.abc import Iterator
@pytest.fixture()
def sig_elements() -> Generator[set[type[addnodes.desc_sig_element]], None, None]:
def sig_elements() -> Iterator[set[type[addnodes.desc_sig_element]]]:
"""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