summaryrefslogtreecommitdiffstats
path: root/tests/roots/test-ext-autodoc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:57:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:57:09 +0000
commit2722609ed8cf1f24bb6a8b8a5ad9d7ac6dec58c3 (patch)
treee0f8becff83e01bc4228b1824e81a6a355d6e439 /tests/roots/test-ext-autodoc
parentReleasing progress-linux version 7.3.7-3~progress7.99u1. (diff)
downloadsphinx-2722609ed8cf1f24bb6a8b8a5ad9d7ac6dec58c3.tar.xz
sphinx-2722609ed8cf1f24bb6a8b8a5ad9d7ac6dec58c3.zip
Merging upstream version 7.4.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/roots/test-ext-autodoc')
-rw-r--r--tests/roots/test-ext-autodoc/conf.py3
-rw-r--r--tests/roots/test-ext-autodoc/target/annotated.py36
2 files changed, 35 insertions, 4 deletions
diff --git a/tests/roots/test-ext-autodoc/conf.py b/tests/roots/test-ext-autodoc/conf.py
index 979a709..9d1cdc7 100644
--- a/tests/roots/test-ext-autodoc/conf.py
+++ b/tests/roots/test-ext-autodoc/conf.py
@@ -5,9 +5,6 @@ sys.path.insert(0, os.path.abspath('.'))
extensions = ['sphinx.ext.autodoc']
-# The suffix of source filenames.
-source_suffix = '.rst'
-
autodoc_mock_imports = [
'dummy'
]
diff --git a/tests/roots/test-ext-autodoc/target/annotated.py b/tests/roots/test-ext-autodoc/target/annotated.py
index 5b87518..7adc3e0 100644
--- a/tests/roots/test-ext-autodoc/target/annotated.py
+++ b/tests/roots/test-ext-autodoc/target/annotated.py
@@ -1,8 +1,42 @@
-from __future__ import annotations
+# from __future__ import annotations
+import dataclasses
+import types
from typing import Annotated
+@dataclasses.dataclass(frozen=True)
+class FuncValidator:
+ func: types.FunctionType
+
+
+@dataclasses.dataclass(frozen=True)
+class MaxLen:
+ max_length: int
+ whitelisted_words: list[str]
+
+
+def validate(value: str) -> str:
+ return value
+
+
+#: Type alias for a validated string.
+ValidatedString = Annotated[str, FuncValidator(validate)]
+
+
def hello(name: Annotated[str, "attribute"]) -> None:
"""docstring"""
pass
+
+
+class AnnotatedAttributes:
+ """docstring"""
+
+ #: Docstring about the ``name`` attribute.
+ name: Annotated[str, "attribute"]
+
+ #: Docstring about the ``max_len`` attribute.
+ max_len: list[Annotated[str, MaxLen(10, ['word_one', 'word_two'])]]
+
+ #: Docstring about the ``validated`` attribute.
+ validated: ValidatedString