mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #860: Do not crash when encountering invalid doctest examples, just emit a warning.
This commit is contained in:
parent
5727c053c2
commit
5b63fbfd44
3
CHANGES
3
CHANGES
@ -17,6 +17,9 @@ Release 1.1.3 (in development)
|
|||||||
* #859: Fix exception under certain circumstances when not finding
|
* #859: Fix exception under certain circumstances when not finding
|
||||||
appropriate objects to link to.
|
appropriate objects to link to.
|
||||||
|
|
||||||
|
* #860: Do not crash when encountering invalid doctest examples, just
|
||||||
|
emit a warning.
|
||||||
|
|
||||||
|
|
||||||
Release 1.1.2 (Nov 1, 2011) -- 1.1.1 is a silly version number anyway!
|
Release 1.1.2 (Nov 1, 2011) -- 1.1.1 is a silly version number anyway!
|
||||||
======================================================================
|
======================================================================
|
||||||
|
@ -375,8 +375,13 @@ Doctest summary
|
|||||||
for code in group.tests:
|
for code in group.tests:
|
||||||
if len(code) == 1:
|
if len(code) == 1:
|
||||||
# ordinary doctests (code/output interleaved)
|
# ordinary doctests (code/output interleaved)
|
||||||
|
try:
|
||||||
test = parser.get_doctest(code[0].code, {}, group.name,
|
test = parser.get_doctest(code[0].code, {}, group.name,
|
||||||
filename, code[0].lineno)
|
filename, code[0].lineno)
|
||||||
|
except Exception:
|
||||||
|
self.warn('ignoring invalid doctest code: %r' % code[0].code,
|
||||||
|
'%s:%s' % (filename, code[0].lineno))
|
||||||
|
continue
|
||||||
if not test.examples:
|
if not test.examples:
|
||||||
continue
|
continue
|
||||||
for example in test.examples:
|
for example in test.examples:
|
||||||
|
Loading…
Reference in New Issue
Block a user