summaryrefslogtreecommitdiff
path: root/tests/sphinx/testdata
diff options
context:
space:
mode:
authorJoachim Jablon <ewjoachim@gmail.com>2023-06-02 00:33:27 +0100
committernessita <124304+nessita@users.noreply.github.com>2024-05-14 22:08:29 -0300
commitb691accea13da0f703728b1d62657cb7ba87da60 (patch)
tree3860849afca49f0c5ecb7493baa7f9f0a0298f3d /tests/sphinx/testdata
parentf030236a86a64a4befd3cc8093e2bbeceef52a31 (diff)
Fixed #29942 -- Restored source file linking in docs by using the Sphinx linkcode ext.
Co-authored-by: David Smith <smithdc@gmail.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Diffstat (limited to 'tests/sphinx/testdata')
-rw-r--r--tests/sphinx/testdata/package/__init__.py2
-rw-r--r--tests/sphinx/testdata/package/import_error.py5
-rw-r--r--tests/sphinx/testdata/package/module.py25
-rw-r--r--tests/sphinx/testdata/package/other_module.py2
-rw-r--r--tests/sphinx/testdata/package/wildcard_base.py2
-rw-r--r--tests/sphinx/testdata/package/wildcard_module.py5
6 files changed, 41 insertions, 0 deletions
diff --git a/tests/sphinx/testdata/package/__init__.py b/tests/sphinx/testdata/package/__init__.py
new file mode 100644
index 0000000000..3a41636b7b
--- /dev/null
+++ b/tests/sphinx/testdata/package/__init__.py
@@ -0,0 +1,2 @@
+# This file should never get imported. If it is, then something failed already.
+raise Exception
diff --git a/tests/sphinx/testdata/package/import_error.py b/tests/sphinx/testdata/package/import_error.py
new file mode 100644
index 0000000000..3eb0a2288f
--- /dev/null
+++ b/tests/sphinx/testdata/package/import_error.py
@@ -0,0 +1,5 @@
+from .....test import Test # noqa
+
+
+class MyClass:
+ pass
diff --git a/tests/sphinx/testdata/package/module.py b/tests/sphinx/testdata/package/module.py
new file mode 100644
index 0000000000..987923b55e
--- /dev/null
+++ b/tests/sphinx/testdata/package/module.py
@@ -0,0 +1,25 @@
+"""
+Example docstring
+"""
+
+from django.utils.functional import cached_property
+from tests.sphinx.testdata.package.wildcard_module import * # noqa
+
+from . import other_module # noqa
+from .other_module import MyOtherClass # noqa
+
+
+class MyClass(object):
+ def __init__(self):
+ pass
+
+ def my_method(self):
+ pass
+
+ @cached_property
+ def my_cached_property(self):
+ pass
+
+
+def my_function(self):
+ pass
diff --git a/tests/sphinx/testdata/package/other_module.py b/tests/sphinx/testdata/package/other_module.py
new file mode 100644
index 0000000000..f210b8e158
--- /dev/null
+++ b/tests/sphinx/testdata/package/other_module.py
@@ -0,0 +1,2 @@
+class MyOtherClass:
+ pass
diff --git a/tests/sphinx/testdata/package/wildcard_base.py b/tests/sphinx/testdata/package/wildcard_base.py
new file mode 100644
index 0000000000..e8c5b97cb9
--- /dev/null
+++ b/tests/sphinx/testdata/package/wildcard_base.py
@@ -0,0 +1,2 @@
+class WildcardMixin:
+ pass
diff --git a/tests/sphinx/testdata/package/wildcard_module.py b/tests/sphinx/testdata/package/wildcard_module.py
new file mode 100644
index 0000000000..187e367b72
--- /dev/null
+++ b/tests/sphinx/testdata/package/wildcard_module.py
@@ -0,0 +1,5 @@
+from .wildcard_base import WildcardMixin # noqa
+
+
+class WildcardClass:
+ pass