mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
[lint] run `mypy on tests/test_addnodes.py` (#12111)
This commit is contained in:
@@ -217,7 +217,6 @@ disallow_any_generics = false
|
||||
module = [
|
||||
# tests/
|
||||
# "tests.conftest",
|
||||
"tests.test_addnodes",
|
||||
"tests.test_errors",
|
||||
"tests.test_events",
|
||||
"tests.test_highlighting",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user