mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Move mypy test module exclusions to per-module ignores (#13265)
This commit is contained in:
@@ -320,7 +320,7 @@ def test_autodoc_process_signature_typehints(app):
|
||||
|
||||
app.connect('autodoc-process-signature', process_signature)
|
||||
|
||||
def func(x: int, y: int) -> int:
|
||||
def func(x: int, y: int) -> int: # type: ignore[empty-body]
|
||||
pass
|
||||
|
||||
directive = make_directive_bridge(app.env)
|
||||
|
@@ -71,7 +71,7 @@ def test_cut_lines_no_objtype():
|
||||
]
|
||||
process = cut_lines(2)
|
||||
|
||||
process(None, 'function', 'func', None, {}, docstring_lines) # type: ignore[arg-type]
|
||||
process(None, 'function', 'func', None, {}, docstring_lines)
|
||||
assert docstring_lines == [
|
||||
'second line',
|
||||
'---',
|
||||
|
@@ -240,7 +240,7 @@ def test_escaping(app):
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='ext-autosummary')
|
||||
def test_autosummary_generate_content_for_module(app):
|
||||
import autosummary_dummy_module
|
||||
import autosummary_dummy_module # type: ignore[import-not-found]
|
||||
|
||||
template = Mock()
|
||||
|
||||
@@ -457,7 +457,7 @@ def test_autosummary_generate_content_for_module_imported_members(app):
|
||||
|
||||
@pytest.mark.sphinx('html', testroot='ext-autosummary')
|
||||
def test_autosummary_generate_content_for_module_imported_members_inherited_module(app):
|
||||
import autosummary_dummy_inherited_module
|
||||
import autosummary_dummy_inherited_module # type: ignore[import-not-found]
|
||||
|
||||
template = Mock()
|
||||
|
||||
|
@@ -75,7 +75,7 @@ def cleanup_call():
|
||||
cleanup_called += 1
|
||||
|
||||
|
||||
recorded_calls = Counter()
|
||||
recorded_calls: Counter[tuple[str, str, int]] = Counter()
|
||||
|
||||
|
||||
@pytest.mark.sphinx('doctest', testroot='ext-doctest-skipif')
|
||||
|
@@ -327,7 +327,7 @@ def test_import_classes(rootdir):
|
||||
saved_path = sys.path.copy()
|
||||
sys.path.insert(0, str(rootdir / 'test-ext-inheritance_diagram'))
|
||||
try:
|
||||
from example.sphinx import DummyClass
|
||||
from example.sphinx import DummyClass # type: ignore[import-not-found]
|
||||
|
||||
# got exception for unknown class or module
|
||||
with pytest.raises(InheritanceException):
|
||||
|
@@ -38,7 +38,7 @@ from tests.test_util.intersphinx_data import (
|
||||
from tests.utils import http_server
|
||||
|
||||
|
||||
class FakeList(list): # NoQA: FURB189
|
||||
class FakeList(list[str]):
|
||||
def __iter__(self) -> NoReturn:
|
||||
raise NotImplementedError
|
||||
|
||||
|
Reference in New Issue
Block a user