diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-10-04 22:23:45 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-10-05 22:49:05 +0900 |
| commit | 6dbe28a632c4c9c6c12beaf8e0f6a00d5fa163c6 (patch) | |
| tree | 6207dfe0ab0e78997b3d01d05a9ac488c01c0daa /tests | |
| parent | a8abb9995f71b9bc02b6f83592751c779ae0f75a (diff) | |
| download | sphinx-git-6dbe28a632c4c9c6c12beaf8e0f6a00d5fa163c6.tar.gz | |
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.py | 5 | ||||
| -rw-r--r-- | tests/test_ext_autodoc.py | 16 |
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') |
