mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix automsummary directive wrong processing for invalid modules.
This commit is contained in:
@@ -302,8 +302,7 @@ class Autosummary(SphinxDirective):
|
||||
with mock(self.config.autosummary_mock_imports):
|
||||
real_name, obj, parent, modname = import_by_name(name, prefixes=prefixes)
|
||||
except ImportError:
|
||||
logger.warning(__('failed to import %s'), name)
|
||||
items.append((name, '', '', name))
|
||||
logger.warning(__('autosummary: failed to import %s'), name)
|
||||
continue
|
||||
|
||||
self.bridge.result = StringList() # initialize for each documenter
|
||||
|
||||
@@ -397,7 +397,7 @@ def test_autosummary_template(app):
|
||||
confoverrides={'autosummary_generate': []})
|
||||
def test_empty_autosummary_generate(app, status, warning):
|
||||
app.build()
|
||||
assert ("WARNING: autosummary: stub file not found 'autosummary_importfail'"
|
||||
assert ("WARNING: autosummary: failed to import autosummary_importfail"
|
||||
in warning.getvalue())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user