summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTal Einat <taleinat+github@gmail.com>2018-07-10 13:28:09 +0300
committerGitHub <noreply@github.com>2018-07-10 13:28:09 +0300
commit6f036bb67d5a20c86c29ea5aeace563e3751baab (patch)
tree52ff31a04ba3b44bb5b09c20e63288f782d00ef9
parentdc39a59bc7072f540b7bab5b7db78ec04423700a (diff)
downloadcpython-git-6f036bb67d5a20c86c29ea5aeace563e3751baab.tar.gz
[2.7] bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091) (#8225)
Actually just one fix on the 2.7 branch. Contributed by Bradley Laney. (cherry picked from commit 6b490b5db40fc29588e8e6cc23bb89c4fed74ad5)
-rw-r--r--Lib/test/test_file.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 57e640d336..6bfc4e63e7 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -247,8 +247,7 @@ class OtherFileTests(unittest.TestCase):
# 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()