gh-71339: Use new assertion methods in the urllib tests (GH-129056)

This commit is contained in:
Serhiy Storchaka 2025-04-14 09:24:41 +03:00 committed by GitHub
parent 7a29c9883f
commit f98b9b4cbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 20 deletions

View file

@ -1164,14 +1164,13 @@ class UrlParseTestCase(unittest.TestCase):
with self.subTest(url=url, function=func):
result = func(url, allow_fragments=False)
self.assertEqual(result.fragment, "")
self.assertTrue(
getattr(result, attr).endswith("#" + expected_frag))
self.assertEndsWith(getattr(result, attr),
"#" + expected_frag)
self.assertEqual(func(url, "", False).fragment, "")
result = func(url, allow_fragments=True)
self.assertEqual(result.fragment, expected_frag)
self.assertFalse(
getattr(result, attr).endswith(expected_frag))
self.assertNotEndsWith(getattr(result, attr), expected_frag)
self.assertEqual(func(url, "", True).fragment,
expected_frag)
self.assertEqual(func(url).fragment, expected_frag)