diff options
Diffstat (limited to 'Lib/test/test_doctest.py')
-rw-r--r-- | Lib/test/test_doctest.py | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 1f89ac2..b17607d 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -604,8 +604,8 @@ DocTestFinder finds the line number of each example: ... >>> for x in range(10): ... ... print x, ... 0 1 2 3 4 5 6 7 8 9 - ... >>> x/2 - ... 6.0 + ... >>> x//2 + ... 6 ... ''' >>> test = doctest.DocTestFinder().find(f)[0] >>> [e.lineno for e in test.examples] @@ -679,8 +679,8 @@ statistics. Here's a simple DocTest case we can use: ... >>> x = 12 ... >>> print x ... 12 - ... >>> x/2 - ... 6.0 + ... >>> x//2 + ... 6 ... ''' >>> test = doctest.DocTestFinder().find(f)[0] @@ -700,8 +700,8 @@ the failure and proceeds to the next example: ... >>> x = 12 ... >>> print x ... 14 - ... >>> x/2 - ... 6.0 + ... >>> x//2 + ... 6 ... ''' >>> test = doctest.DocTestFinder().find(f)[0] >>> doctest.DocTestRunner(verbose=True).run(test) @@ -723,9 +723,9 @@ the failure and proceeds to the next example: Got: 12 Trying: - x/2 + x//2 Expecting: - 6.0 + 6 ok (1, 3) """ @@ -738,8 +738,8 @@ output: ... >>> x = 12 ... >>> print x ... 12 - ... >>> x/2 - ... 6.0 + ... >>> x//2 + ... 6 ... ''' >>> test = doctest.DocTestFinder().find(f)[0] @@ -754,9 +754,9 @@ output: 12 ok Trying: - x/2 + x//2 Expecting: - 6.0 + 6 ok (0, 3) @@ -784,9 +784,9 @@ iff `-v` appears in sys.argv: 12 ok Trying: - x/2 + x//2 Expecting: - 6.0 + 6 ok (0, 3) @@ -806,9 +806,9 @@ replaced with any other string: >>> def f(x): ... ''' ... >>> x = 12 - ... >>> print x/0 + ... >>> print x//0 ... Traceback (most recent call last): - ... ZeroDivisionError: float division + ... ZeroDivisionError: integer division or modulo by zero ... ''' >>> test = doctest.DocTestFinder().find(f)[0] >>> doctest.DocTestRunner(verbose=False).run(test) @@ -822,10 +822,10 @@ unexpected exception: >>> def f(x): ... ''' ... >>> x = 12 - ... >>> print 'pre-exception output', x/0 + ... >>> print 'pre-exception output', x//0 ... pre-exception output ... Traceback (most recent call last): - ... ZeroDivisionError: float division + ... ZeroDivisionError: integer division or modulo by zero ... ''' >>> test = doctest.DocTestFinder().find(f)[0] >>> doctest.DocTestRunner(verbose=False).run(test) @@ -833,10 +833,10 @@ unexpected exception: ********************************************************************** File ..., line 4, in f Failed example: - print 'pre-exception output', x/0 + print 'pre-exception output', x//0 Exception raised: ... - ZeroDivisionError: float division + ZeroDivisionError: integer division or modulo by zero (1, 2) Exception messages may contain newlines: @@ -920,7 +920,7 @@ unexpected exception: >>> def f(x): ... r''' - ... >>> 1/0 + ... >>> 1//0 ... 0 ... ''' >>> test = doctest.DocTestFinder().find(f)[0] @@ -929,11 +929,11 @@ unexpected exception: ********************************************************************** File ..., line 3, in f Failed example: - 1/0 + 1//0 Exception raised: Traceback (most recent call last): ... - ZeroDivisionError: float division + ZeroDivisionError: integer division or modulo by zero (1, 1) """ def optionflags(): r""" |