diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2016-10-19 10:11:37 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2016-10-19 10:11:37 +0200 |
| commit | bd1b49a242f8430c4f3730ab44f044b67017838b (patch) | |
| tree | 82bee584f87e32713d2930fecc6488b709378ea6 | |
| parent | 26d0ccd51bc02177c04e5271448ce42ea0931de8 (diff) | |
| download | cpython-git-bd1b49a242f8430c4f3730ab44f044b67017838b.tar.gz | |
Close #28476: Reuse math.factorial() in test_random
Patch written by Francisco Couzo.
| -rw-r--r-- | Lib/test/test_random.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 4d5a8749c7..d061829aa0 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -5,7 +5,7 @@ import time import pickle import warnings from functools import partial -from math import log, exp, pi, fsum, sin +from math import log, exp, pi, fsum, sin, factorial from test import support from fractions import Fraction @@ -117,10 +117,6 @@ class TestBasicOps: n = 5 pop = range(n) trials = 10000 # large num prevents false negatives without slowing normal case - def factorial(n): - if n == 0: - return 1 - return n * factorial(n - 1) for k in range(n): expected = factorial(n) // factorial(n-k) perms = {} |
