1
0
mirror of https://github.com/django/django.git synced 2025-03-24 00:00:45 +00:00

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.
This commit is contained in:
Claude Paroz 2014-10-23 11:16:17 +02:00
parent ef9e3c5ed8
commit bc6caa5d45

View File

@ -9,8 +9,8 @@ def factorial(n):
>>> [factorial(n) for n in range(6)]
[1, 1, 2, 6, 24, 120]
>>> factorial(30)
265252859812191058636308480000000
>>> factorial(30) # doctest: +ELLIPSIS
265252859812191058636308480000000...
>>> factorial(-1)
Traceback (most recent call last):
...
@ -21,8 +21,8 @@ def factorial(n):
Traceback (most recent call last):
...
ValueError: n must be exact integer
>>> factorial(30.0)
265252859812191058636308480000000
>>> factorial(30.0) # doctest: +ELLIPSIS
265252859812191058636308480000000...
It must also not be ridiculously large:
>>> factorial(1e100)