From 3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lemburg?= Date: Wed, 17 Jan 2001 19:11:13 +0000 Subject: This patch removes all uses of "assert" in the regression test suite and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum. --- Lib/test/test_long.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Lib/test/test_long.py') diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index 5e0e001f02..1059ef6d8c 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -1,4 +1,4 @@ -from test_support import TestFailed, verbose +from test_support import verify, verbose, TestFailed from string import join from random import random, randint @@ -41,7 +41,7 @@ def check(ok, *args): # The sign of the number is also random. def getran(ndigits): - assert ndigits > 0 + verify(ndigits > 0) nbits_hi = ndigits * SHIFT nbits_lo = nbits_hi - SHIFT + 1 answer = 0L @@ -50,13 +50,13 @@ def getran(ndigits): while nbits < nbits_lo: bits = (r >> 1) + 1 bits = min(bits, nbits_hi - nbits) - assert 1 <= bits <= SHIFT + verify(1 <= bits <= SHIFT) nbits = nbits + bits answer = answer << bits if r & 1: answer = answer | ((1 << bits) - 1) r = int(random() * (SHIFT * 2)) - assert nbits_lo <= nbits <= nbits_hi + verify(nbits_lo <= nbits <= nbits_hi) if random() < 0.5: answer = -answer return answer -- cgit v1.2.1