Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(276121)

Unified Diff: Lib/test/test_zlib.py

Issue 16510: Using appropriate checks in tests
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_xmlrpc.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_zlib.py Fri Feb 07 17:53:13 2014 +0100
+++ b/Lib/test/test_zlib.py Fri Feb 07 23:40:05 2014 +0200
@@ -311,8 +311,7 @@
while cb:
#max_length = 1 + len(cb)//10
chunk = dco.decompress(cb, dcx)
- self.assertFalse(len(chunk) > dcx,
- 'chunk too big (%d>%d)' % (len(chunk), dcx))
+ self.assertLessEqual(len(chunk), dcx)
bufs.append(chunk)
cb = dco.unconsumed_tail
bufs.append(dco.flush())
@@ -336,8 +335,7 @@
while cb:
max_length = 1 + len(cb)//10
chunk = dco.decompress(cb, max_length)
- self.assertFalse(len(chunk) > max_length,
- 'chunk too big (%d>%d)' % (len(chunk),max_length))
+ self.assertLessEqual(len(chunk), max_length)
bufs.append(chunk)
cb = dco.unconsumed_tail
if flush:
@@ -345,8 +343,7 @@
else:
while chunk:
chunk = dco.decompress(b'', max_length)
- self.assertFalse(len(chunk) > max_length,
- 'chunk too big (%d>%d)' % (len(chunk),max_length))
+ self.assertLessEqual(len(chunk), max_length)
bufs.append(chunk)
self.assertEqual(data, b''.join(bufs), 'Wrong data retrieved')
« no previous file with comments | « Lib/test/test_xmlrpc.py ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+