diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index 57e640d336416b..6bfc4e63e7bb6c 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -247,8 +247,7 @@ def testIteration(self): # 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()