summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-10-06 01:33:22 +0900
committerGitHub <noreply@github.com>2020-10-06 01:33:22 +0900
commit0476e1cea93b587e3c0ab295aa20b2b9f0f81a34 (patch)
treedcaef3ed22fc32823dd612c2805db73ab5e02182 /tests
parentc82d1c76e1e3518381e51450f5b2bc83bc7cc647 (diff)
parent6dbe28a632c4c9c6c12beaf8e0f6a00d5fa163c6 (diff)
downloadsphinx-git-0476e1cea93b587e3c0ab295aa20b2b9f0f81a34.tar.gz
Merge pull request #8283 from tk0miya/7786_overloads_in_other_file
Fix #7786: autodoc: can't detect overloaded methods defined in other file
Diffstat (limited to 'tests')
-rw-r--r--tests/roots/test-ext-autodoc/target/overload2.py5
-rw-r--r--tests/test_ext_autodoc.py16
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/roots/test-ext-autodoc/target/overload2.py b/tests/roots/test-ext-autodoc/target/overload2.py
new file mode 100644
index 000000000..e901f791b
--- /dev/null
+++ b/tests/roots/test-ext-autodoc/target/overload2.py
@@ -0,0 +1,5 @@
+from target.overload import Bar
+
+
+class Baz(Bar):
+ pass
diff --git a/tests/test_ext_autodoc.py b/tests/test_ext_autodoc.py
index 7fff09bb6..9cb54de5b 100644
--- a/tests/test_ext_autodoc.py
+++ b/tests/test_ext_autodoc.py
@@ -2003,6 +2003,22 @@ def test_overload(app):
@pytest.mark.sphinx('html', testroot='ext-autodoc')
+def test_overload2(app):
+ options = {"members": None}
+ actual = do_autodoc(app, 'module', 'target.overload2', options)
+ assert list(actual) == [
+ '',
+ '.. py:module:: target.overload2',
+ '',
+ '',
+ '.. py:class:: Baz(x: int, y: int)',
+ ' Baz(x: str, y: str)',
+ ' :module: target.overload2',
+ '',
+ ]
+
+
+@pytest.mark.sphinx('html', testroot='ext-autodoc')
def test_pymodule_for_ModuleLevelDocumenter(app):
app.env.ref_context['py:module'] = 'target.classes'
actual = do_autodoc(app, 'class', 'Foo')