diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-02 16:37:15 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-05-07 02:02:02 +0900 |
| commit | 560ccf83ae54630280c381fbe92086d0fdeb2090 (patch) | |
| tree | af0ec2370d1281932c4b1237dfd68fa57f3c651a /tests/test_ext_autodoc.py | |
| parent | c4d4ba2835072c8f05b5b755fd65f183ed9e2754 (diff) | |
| download | sphinx-git-560ccf83ae54630280c381fbe92086d0fdeb2090.tar.gz | |
Fix #7551: autodoc: failed to import nested class
Diffstat (limited to 'tests/test_ext_autodoc.py')
| -rw-r--r-- | tests/test_ext_autodoc.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/test_ext_autodoc.py b/tests/test_ext_autodoc.py index 23ba2e733..4833daa8b 100644 --- a/tests/test_ext_autodoc.py +++ b/tests/test_ext_autodoc.py @@ -103,27 +103,27 @@ def test_parse_name(app): directive = make_directive_bridge(app.env) # for modules - verify('module', 'test_autodoc', ('test_autodoc', [], None, None)) - verify('module', 'test.test_autodoc', ('test.test_autodoc', [], None, None)) + verify('module', 'test_ext_autodoc', ('test_ext_autodoc', [], None, None)) + verify('module', 'test.test_ext_autodoc', ('test.test_ext_autodoc', [], None, None)) verify('module', 'test(arg)', ('test', [], 'arg', None)) assert 'signature arguments' in app._warning.getvalue() # for functions/classes - verify('function', 'test_autodoc.raises', - ('test_autodoc', ['raises'], None, None)) - verify('function', 'test_autodoc.raises(exc) -> None', - ('test_autodoc', ['raises'], 'exc', 'None')) - directive.env.temp_data['autodoc:module'] = 'test_autodoc' - verify('function', 'raises', ('test_autodoc', ['raises'], None, None)) + verify('function', 'test_ext_autodoc.raises', + ('test_ext_autodoc', ['raises'], None, None)) + verify('function', 'test_ext_autodoc.raises(exc) -> None', + ('test_ext_autodoc', ['raises'], 'exc', 'None')) + directive.env.temp_data['autodoc:module'] = 'test_ext_autodoc' + verify('function', 'raises', ('test_ext_autodoc', ['raises'], None, None)) del directive.env.temp_data['autodoc:module'] - directive.env.ref_context['py:module'] = 'test_autodoc' - verify('function', 'raises', ('test_autodoc', ['raises'], None, None)) - verify('class', 'Base', ('test_autodoc', ['Base'], None, None)) + directive.env.ref_context['py:module'] = 'test_ext_autodoc' + verify('function', 'raises', ('test_ext_autodoc', ['raises'], None, None)) + verify('class', 'Base', ('test_ext_autodoc', ['Base'], None, None)) # for members directive.env.ref_context['py:module'] = 'foo' verify('method', 'util.SphinxTestApp.cleanup', - ('util', ['SphinxTestApp', 'cleanup'], None, None)) + ('foo', ['util', 'SphinxTestApp', 'cleanup'], None, None)) directive.env.ref_context['py:module'] = 'util' directive.env.ref_context['py:class'] = 'Foo' directive.env.temp_data['autodoc:class'] = 'SphinxTestApp' @@ -735,14 +735,14 @@ def test_autodoc_inner_class(app): actual = do_autodoc(app, 'class', 'target.Outer.Inner', options) assert list(actual) == [ '', - '.. py:class:: Inner', - ' :module: target.Outer', + '.. py:class:: Outer.Inner', + ' :module: target', '', ' Foo', '', '', - ' .. py:method:: Inner.meth()', - ' :module: target.Outer', + ' .. py:method:: Outer.Inner.meth()', + ' :module: target', '', ' Foo', '', |
