There was an error while loading. Please reload this page.
1 parent c0c802d commit dfbcdb4Copy full SHA for dfbcdb4
1 file changed
Lib/test/test_xml_etree.py
@@ -1072,8 +1072,8 @@ def test_parse_text_source(self):
1072
# gh-99064: The encoding declared in the document does not apply
1073
# to a source which is already decoded.
1074
def check(encoding, body):
1075
- xml = ("<?xml version='1.0' encoding='%s'?><xml>%s</xml>" %
1076
- (encoding, body))
+ xml = (f"<?xml version='1.0' encoding='{encoding}'?>"
+ f"<xml>{body}</xml>")
1077
with self.subTest(encoding=encoding):
1078
self.assertEqual(ET.parse(io.StringIO(xml)).getroot().text,
1079
body)
0 commit comments