mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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.
This commit is contained in:
parent
8551dd6078
commit
3661908a6a
70 changed files with 436 additions and 412 deletions
|
@ -1,6 +1,6 @@
|
|||
"""Test the binascii C module."""
|
||||
|
||||
from test_support import verbose
|
||||
from test_support import verify, verbose
|
||||
import binascii
|
||||
|
||||
# Show module doc string
|
||||
|
@ -42,7 +42,7 @@ res = ""
|
|||
for line in lines:
|
||||
b = binascii.a2b_base64(line)
|
||||
res = res + b
|
||||
assert res == testdata
|
||||
verify(res == testdata)
|
||||
|
||||
# Test base64 with random invalid characters sprinkled throughout
|
||||
# (This requires a new version of binascii.)
|
||||
|
@ -67,7 +67,7 @@ res = ""
|
|||
for line in map(addnoise, lines):
|
||||
b = binascii.a2b_base64(line)
|
||||
res = res + b
|
||||
assert res == testdata
|
||||
verify(res == testdata)
|
||||
|
||||
# Test uu
|
||||
print "uu test"
|
||||
|
@ -82,7 +82,7 @@ res = ""
|
|||
for line in lines:
|
||||
b = binascii.a2b_uu(line)
|
||||
res = res + b
|
||||
assert res == testdata
|
||||
verify(res == testdata)
|
||||
|
||||
# Test crc32()
|
||||
crc = binascii.crc32("Test the CRC-32 of")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue