diff options
author | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
commit | 3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e (patch) | |
tree | eea0f44df59aaaf014eb4580f1fad308e31601bf /Lib/test/test_gzip.py | |
parent | 8551dd60781f738e5e5ef4e22b6f071d27e20b50 (diff) | |
download | cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.zip cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.gz cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_gzip.py')
-rw-r--r-- | Lib/test/test_gzip.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index 7edc617..8191267 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -18,13 +18,13 @@ data2 = """/* zlibmodule.c -- gzip-compatible data compression */ f = gzip.GzipFile(filename, 'wb') ; f.write(data1 * 50) ; f.close() f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close() -assert d == data1*50 +verify(d == data1*50) # Append to the previous file f = gzip.GzipFile(filename, 'ab') ; f.write(data2 * 15) ; f.close() f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close() -assert d == (data1*50) + (data2*15) +verify(d == (data1*50) + (data2*15)) # Try .readline() with varying line lengths @@ -33,7 +33,7 @@ line_length = 0 while 1: L = f.readline( line_length ) if L == "" and line_length != 0: break - assert len(L) <= line_length + verify(len(L) <= line_length) line_length = (line_length + 1) % 50 f.close() |