summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÁlvaro Mondéjar <mondejar1994@gmail.com>2020-05-14 17:06:12 +0200
committerÁlvaro Mondéjar <mondejar1994@gmail.com>2020-05-14 17:06:12 +0200
commit1dcfc44ace8f3da33f4ee62448aadee67edd80cc (patch)
tree7b4cbe2d5116f7b14956cbd45067be13e5d4a123
parent1771bbb9277c3b629ac6e708c4c3f355e034c6cd (diff)
downloadsphinx-git-1dcfc44ace8f3da33f4ee62448aadee67edd80cc.tar.gz
Fix automsummary directive wrong processing for invalid modules.
-rw-r--r--sphinx/ext/autosummary/__init__.py3
-rw-r--r--tests/test_ext_autosummary.py2
2 files changed, 2 insertions, 3 deletions
diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py
index ed49c56df..0cdd88feb 100644
--- a/sphinx/ext/autosummary/__init__.py
+++ b/sphinx/ext/autosummary/__init__.py
@@ -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
diff --git a/tests/test_ext_autosummary.py b/tests/test_ext_autosummary.py
index 365a5a53c..dadedde70 100644
--- a/tests/test_ext_autosummary.py
+++ b/tests/test_ext_autosummary.py
@@ -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())