- Added __docformat__
- Added comments for some regexps
- If the traceback type/message don't match, then still print full
traceback in report_failure (not just the first & last lines)
- Renamed DocTestRunner.__failure_header -> _failure_header
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 977ade7..c734cae 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -269,10 +269,10 @@
>>> finder = doctest.DocTestFinder()
>>> tests = finder.find(sample_func)
-
+
>>> print tests # doctest: +ELLIPSIS
[<DocTest sample_func from ...:12 (1 example)>]
-
+
>>> e = tests[0].examples[0]
>>> (e.source, e.want, e.lineno)
('print sample_func(22)\n', '44\n', 3)
@@ -620,6 +620,7 @@
... '''
>>> test = doctest.DocTestFinder().find(f)[0]
>>> doctest.DocTestRunner(verbose=False).run(test)
+ ... # doctest: +ELLIPSIS
**********************************************************************
Failure in example: raise ValueError, 'message'
from line #1 of f
@@ -628,6 +629,7 @@
ValueError: wrong message
Got:
Traceback (most recent call last):
+ ...
ValueError: message
(1, 1)
@@ -897,7 +899,7 @@
Option directives affect only the example that they appear with; they
do not change the options for surrounding examples:
-
+
>>> def f(x): r'''
... >>> print range(10) # Should fail: no ellipsis
... [0, 1, ..., 9]
@@ -984,7 +986,7 @@
>>> test = doctest.DocTestFinder().find(f)[0]
>>> doctest.DocTestRunner(verbose=False).run(test)
(0, 1)
-
+
For examples with multi-line source, the option directive may appear
at the end of any line: