mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Require the PEP 563 'annotations' future import
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"""Test module for napoleon PEP 526 compatibility with google style"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
module_level_var: int = 99
|
||||
"""This is an example module level variable"""
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test module for napoleon PEP 526 compatibility with numpy style"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
module_level_var: int = 99
|
||||
"""This is an example module level variable"""
|
||||
|
||||
|
@@ -1,13 +1,18 @@
|
||||
"""Test the sphinx.apidoc module."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections import namedtuple
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import pytest
|
||||
|
||||
import sphinx.ext.apidoc
|
||||
from sphinx.ext.apidoc import main as apidoc_main
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
||||
_apidoc = namedtuple('_apidoc', 'coderoot,outdir') # NoQA: PYI024
|
||||
|
||||
|
||||
|
@@ -4,6 +4,8 @@ This tests mainly the Documenters; the auto directives are tested in a test
|
||||
source file translated by test_build.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.test_extensions.autodoc_util import do_autodoc
|
||||
|
@@ -4,6 +4,8 @@ This tests mainly the Documenters; the auto directives are tested in a test
|
||||
source file translated by test_build.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.test_extensions.autodoc_util import do_autodoc
|
||||
|
@@ -4,6 +4,8 @@ This tests mainly the Documenters; the auto directives are tested in a test
|
||||
source file translated by test_build.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
import pytest
|
||||
|
@@ -4,6 +4,8 @@ This tests mainly the Documenters; the auto directives are tested in a test
|
||||
source file translated by test_build.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import sys
|
||||
import typing
|
||||
|
@@ -4,6 +4,8 @@ This tests mainly the Documenters; the auto directives are tested in a test
|
||||
source file translated by test_build.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.test_extensions.autodoc_util import do_autodoc
|
||||
|
@@ -1,10 +1,11 @@
|
||||
"""Test the autodoc extension. This tests mainly for config variables"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import platform
|
||||
import sys
|
||||
from collections.abc import Iterator
|
||||
from contextlib import contextmanager
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -12,6 +13,10 @@ from sphinx.testing import restructuredtext
|
||||
|
||||
from tests.test_extensions.autodoc_util import do_autodoc
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Iterator
|
||||
from pathlib import Path
|
||||
|
||||
skip_py314_segfault = pytest.mark.skipif(
|
||||
sys.version_info[:2] >= (3, 14),
|
||||
reason='Segmentation fault: https://github.com/python/cpython/issues/125017',
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test the autodoc extension. This tests mainly for autodoc events"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from sphinx.ext.autodoc import between, cut_lines
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test the autodoc extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.test_extensions.autodoc_util import do_autodoc
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test the autodoc extension. This tests mainly for private-members option."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.test_extensions.autodoc_util import do_autodoc
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test sphinx.ext.autosectionlabel extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
@@ -1,10 +1,12 @@
|
||||
"""Test the autosummary extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from contextlib import chdir
|
||||
from io import StringIO
|
||||
from typing import TYPE_CHECKING
|
||||
from unittest.mock import Mock, patch
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
import pytest
|
||||
from docutils import nodes
|
||||
@@ -26,6 +28,9 @@ from sphinx.ext.autosummary.generate import main as autogen_main
|
||||
from sphinx.testing.util import assert_node, etree_parse
|
||||
from sphinx.util.docutils import new_document
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
html_warnfile = StringIO()
|
||||
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test autosummary for import cycles."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from docutils import nodes
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test the coverage builder."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pickle
|
||||
|
||||
import pytest
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test the doctest extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from collections import Counter
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test sphinx.ext.duration extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test sphinx.ext.githubpages extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test sphinx.ext.graphviz extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test sphinx.ext.ifconfig extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import docutils.utils
|
||||
import pytest
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test sphinx.ext.imgconverter extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
|
||||
import pytest
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test image converter with identical basenames"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test sphinx.ext.inheritance_diagram extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import sys
|
||||
import zlib
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test math extensions."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Tests for :mod:`sphinx.ext.napoleon.__init__` module."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
from collections import namedtuple
|
||||
from unittest import mock
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Tests for :mod:`sphinx.ext.napoleon.docstring` module."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import zlib
|
||||
from collections import namedtuple
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test sphinx.ext.todo extension."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
import pytest
|
||||
|
@@ -1,5 +1,7 @@
|
||||
"""Test sphinx.extension module."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from sphinx.errors import VersionRequirementError
|
||||
|
Reference in New Issue
Block a user