Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/test/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def testIteration(self):
for methodname, args in methods:
f = self.open(TESTFN, 'rb')
if next(f) != filler:
self.fail, "Broken testfile"
self.fail("Broken testfile")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't be better to use assertEqual()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, looks a bit neater.

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
Original file line number Diff line number Diff line change
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(f"Basic auth failed for the url: {self.server_url}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using %-formatting rather than an f-string would make backporting this much easier, since this is to be backported to 2.7.


def test_basic_auth_httperror(self):
ah = urllib.request.HTTPBasicAuthHandler()
Expand Down