Kaydet (Commit) bc6caa5d authored tarafından Claude Paroz's avatar Claude Paroz

Made a doctest compatible with Python 2

That test might not always execute, but can be executed when the
parent test label is explicitely given.
üst ef9e3c5e
...@@ -9,8 +9,8 @@ def factorial(n): ...@@ -9,8 +9,8 @@ def factorial(n):
>>> [factorial(n) for n in range(6)] >>> [factorial(n) for n in range(6)]
[1, 1, 2, 6, 24, 120] [1, 1, 2, 6, 24, 120]
>>> factorial(30) >>> factorial(30) # doctest: +ELLIPSIS
265252859812191058636308480000000 265252859812191058636308480000000...
>>> factorial(-1) >>> factorial(-1)
Traceback (most recent call last): Traceback (most recent call last):
... ...
...@@ -21,8 +21,8 @@ def factorial(n): ...@@ -21,8 +21,8 @@ def factorial(n):
Traceback (most recent call last): Traceback (most recent call last):
... ...
ValueError: n must be exact integer ValueError: n must be exact integer
>>> factorial(30.0) >>> factorial(30.0) # doctest: +ELLIPSIS
265252859812191058636308480000000 265252859812191058636308480000000...
It must also not be ridiculously large: It must also not be ridiculously large:
>>> factorial(1e100) >>> factorial(1e100)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment