summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_wsgiref.py
diff options
context:
space:
mode:
authorPhillip J. Eby <pje@telecommunity.com>2006-06-12 04:04:32 (GMT)
committerPhillip J. Eby <pje@telecommunity.com>2006-06-12 04:04:32 (GMT)
commit403019b115391a15815805f2004cebedb95ca1c4 (patch)
tree55573b343c2c93231667bf48f35c101ba03beebb /Lib/test/test_wsgiref.py
parent6e73aaab474ab9df512e8f24029ed1c57f39c619 (diff)
downloadcpython-403019b115391a15815805f2004cebedb95ca1c4.zip
cpython-403019b115391a15815805f2004cebedb95ca1c4.tar.gz
cpython-403019b115391a15815805f2004cebedb95ca1c4.tar.bz2
Sync w/external release 0.1.2. Please see PEP 360 before making changes to external packages.
Diffstat (limited to 'Lib/test/test_wsgiref.py')
-rwxr-xr-xLib/test/test_wsgiref.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index c8d1262..1ec271b 100755
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -80,7 +80,7 @@ def run_amock(app=hello_app, data="GET / HTTP/1.0\n\n"):
-def compare_generic_iter(test, make_it, match):
+def compare_generic_iter(make_it,match):
"""Utility to compare a generic 2.1/2.2+ iterator with an iterable
If running under Python 2.2+, this tests the iterator using iter()/next(),
@@ -90,7 +90,7 @@ def compare_generic_iter(test, make_it, match):
it = make_it()
n = 0
for item in match:
- test.assertEqual(it[n], item)
+ if not it[n]==item: raise AssertionError
n+=1
try:
it[n]
@@ -106,10 +106,15 @@ def compare_generic_iter(test, make_it, match):
else:
# Only test iter mode under 2.2+
it = make_it()
- test.assert_(iter(it) is it)
+ if not iter(it) is it: raise AssertionError
for item in match:
- test.assertEqual(it.next(), item)
- test.assertRaises(StopIteration, it.next)
+ if not it.next()==item: raise AssertionError
+ try:
+ it.next()
+ except StopIteration:
+ pass
+ else:
+ raise AssertionError("Too many items from .next()",it)
@@ -203,7 +208,7 @@ class UtilityTests(TestCase):
def make_it(text=text,size=size):
return util.FileWrapper(StringIO(text),size)
- compare_generic_iter(self, make_it, match)
+ compare_generic_iter(make_it,match)
it = make_it()
self.failIf(it.filelike.closed)