Skip to content

Commit

Permalink
bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091)
Browse files Browse the repository at this point in the history
Contributed by Bradley Laney.
(cherry picked from commit 6b490b5)

Co-authored-by: Bradley Laney <bradley.laney@gmail.com>
  • Loading branch information
miss-islington and stoksc committed Jul 10, 2018
1 parent df9f633 commit 125371d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Lib/test/test_file.py
Expand Up @@ -241,8 +241,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()
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_urllib2_localnet.py
Expand Up @@ -306,7 +306,7 @@ def test_basic_auth_success(self):
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()
Expand Down

0 comments on commit 125371d

Please sign in to comment.