Fix #2197: Slightly cryptic error message for missing index.rst file

This commit is contained in:
Takeshi KOMIYA 2016-01-03 20:26:38 +09:00
parent 2bcf92dfb0
commit 7bb685bbe9
3 changed files with 14 additions and 2 deletions

View File

@ -26,6 +26,7 @@ Bugs fixed
* #2201: Fix wrong table caption for tables with over 30 rows
* #2213: Set <blockquote> in the classic theme to fit with <p>
* #1815: Fix linkcheck does not raise an exception if warniserror set to true and link is broken
* #2197: Fix slightly cryptic error message for missing index.rst file
Release 1.3.3 (released Dec 2, 2015)
====================================

View File

@ -618,8 +618,8 @@ class BuildEnvironment:
self._read_serial(docnames, app)
if config.master_doc not in self.all_docs:
self.warn(None, 'master file %s not found' %
self.doc2path(config.master_doc))
raise SphinxError('master file %s not found' %
self.doc2path(config.master_doc))
self.app = None

View File

@ -12,6 +12,7 @@
from six import BytesIO
from textwrap import dedent
from sphinx.errors import SphinxError
from util import with_app, rootdir, tempdir, SkipTest, TestApp
@ -73,6 +74,16 @@ def test_build_all():
yield verify_build, buildername, srcdir
@with_app(buildername='text')
def test_master_doc_not_found(app, status, warning):
(app.srcdir / 'contents.txt').unlink()
try:
app.builder.build_all()
assert False # SphinxError not raised
except Exception as exc:
assert isinstance(exc, SphinxError)
@with_app(buildername='text', testroot='circular')
def test_circular_toctree(app, status, warning):
app.builder.build_all()