... ... print x,
... 0 1 2 3 4 5 6 7 8 9
... >>> x/2
- ... 6
+ ... 6.0
... '''
>>> test = doctest.DocTestFinder().find(f)[0]
>>> [e.lineno for e in test.examples]
... >>> print x
... 12
... >>> x/2
- ... 6
+ ... 6.0
... '''
>>> test = doctest.DocTestFinder().find(f)[0]
... >>> print x
... 14
... >>> x/2
- ... 6
+ ... 6.0
... '''
>>> test = doctest.DocTestFinder().find(f)[0]
>>> doctest.DocTestRunner(verbose=True).run(test)
Trying:
x/2
Expecting:
- 6
+ 6.0
ok
(1, 3)
"""
... >>> print x
... 12
... >>> x/2
- ... 6
+ ... 6.0
... '''
>>> test = doctest.DocTestFinder().find(f)[0]
Trying:
x/2
Expecting:
- 6
+ 6.0
ok
(0, 3)
Trying:
x/2
Expecting:
- 6
+ 6.0
ok
(0, 3)
... >>> x = 12
... >>> print x/0
... Traceback (most recent call last):
- ... ZeroDivisionError: integer division or modulo by zero
+ ... ZeroDivisionError: float division
... '''
>>> test = doctest.DocTestFinder().find(f)[0]
>>> doctest.DocTestRunner(verbose=False).run(test)
... >>> print 'pre-exception output', x/0
... pre-exception output
... Traceback (most recent call last):
- ... ZeroDivisionError: integer division or modulo by zero
+ ... ZeroDivisionError: float division
... '''
>>> test = doctest.DocTestFinder().find(f)[0]
>>> doctest.DocTestRunner(verbose=False).run(test)
print 'pre-exception output', x/0
Exception raised:
...
- ZeroDivisionError: integer division or modulo by zero
+ ZeroDivisionError: float division
(1, 2)
Exception messages may contain newlines:
Exception raised:
Traceback (most recent call last):
...
- ZeroDivisionError: integer division or modulo by zero
+ ZeroDivisionError: float division
(1, 1)
"""
def optionflags(): r"""