From 5ebe03e1afe1fbde89b60f2ccf641034922ebd9a Mon Sep 17 00:00:00 2001 From: Bradley Laney Date: Tue, 10 Jul 2018 05:46:44 -0400 Subject: [PATCH] [2.7] bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091) Contributed by Bradley Laney.. (cherry picked from commit 6b490b5db40fc29588e8e6cc23bb89c4fed74ad5) Co-authored-by: Bradley Laney --- Lib/test/test_file.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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()