summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_file.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-07-10 10:13:06 (GMT)
committerGitHub <noreply@github.com>2018-07-10 10:13:06 (GMT)
commitcb14eb7eedf36cd21aaf41c4d3eb1e6521fa7b11 (patch)
tree03903a39da01e4ee70ab2fbc1dcf51d85b40eaa5 /Lib/test/test_file.py
parent6ceab46a602c6653356d67d7479391fba0b35697 (diff)
downloadcpython-cb14eb7eedf36cd21aaf41c4d3eb1e6521fa7b11.zip
cpython-cb14eb7eedf36cd21aaf41c4d3eb1e6521fa7b11.tar.gz
cpython-cb14eb7eedf36cd21aaf41c4d3eb1e6521fa7b11.tar.bz2
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 <bradley.laney@gmail.com>
Diffstat (limited to 'Lib/test/test_file.py')
-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 9890b8c..f58d1da 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -241,8 +241,7 @@ class OtherFileTests:
# 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()