Skip to content

Remove mypy overrides for test_transforms_move_module_targets #13553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ module = [
"tests.test_theming.test_templating",
"tests.test_theming.test_theming",
# tests/test_transforms
"tests.test_transforms.test_transforms_move_module_targets",
"tests.test_transforms.test_transforms_post_transforms_images",
"tests.test_transforms.test_transforms_reorder_nodes",
# tests/test_util
Expand Down
11 changes: 8 additions & 3 deletions tests/test_transforms/test_transforms_move_module_targets.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import pytest
from docutils import nodes

from sphinx import addnodes
from sphinx.testing.util import SphinxTestApp
from sphinx.transforms import MoveModuleTargets

if TYPE_CHECKING:
from pathlib import Path

CONTENT_PY = """\
move-module-targets
===================
Expand All @@ -29,7 +34,7 @@
],
)
@pytest.mark.usefixtures('rollback_sysmodules')
def test_move_module_targets(tmp_path, content):
def test_move_module_targets(tmp_path: Path, content: str) -> None:
# Test for the MoveModuleTargets transform
tmp_path.joinpath('conf.py').touch()
tmp_path.joinpath('index.rst').write_text(content, encoding='utf-8')
Expand All @@ -48,7 +53,7 @@ def test_move_module_targets(tmp_path, content):


@pytest.mark.usefixtures('rollback_sysmodules')
def test_move_module_targets_no_section(tmp_path):
def test_move_module_targets_no_section(tmp_path: Path) -> None:
# Test for the MoveModuleTargets transform
tmp_path.joinpath('conf.py').touch()
tmp_path.joinpath('index.rst').write_text(
Expand All @@ -63,7 +68,7 @@ def test_move_module_targets_no_section(tmp_path):


@pytest.mark.usefixtures('rollback_sysmodules')
def test_move_module_targets_disabled(tmp_path):
def test_move_module_targets_disabled(tmp_path: Path) -> None:
# Test for the MoveModuleTargets transform
tmp_path.joinpath('conf.py').touch()
tmp_path.joinpath('index.rst').write_text(CONTENT_PY, encoding='utf-8')
Expand Down
Loading