# Test for appropriate errors mixing read* and iteration
for methodname, args in methods:
f = self.open(TESTFN, 'rb')
- if next(f) != filler:
- self.fail, "Broken testfile"
+ self.assertEqual(next(f), filler)
meth = getattr(f, methodname)
meth(*args) # This simply shouldn't fail
f.close()
try:
self.assertTrue(urllib.request.urlopen(self.server_url))
except urllib.error.HTTPError:
- self.fail("Basic auth failed for the url: %s", self.server_url)
+ self.fail("Basic auth failed for the url: %s" % self.server_url)
def test_basic_auth_httperror(self):
ah = urllib.request.HTTPBasicAuthHandler()