Skip to content

Commit dfbcdb4

Browse files
Apply suggestion from @vstinner
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent c0c802d commit dfbcdb4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/test_xml_etree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,8 @@ def test_parse_text_source(self):
10721072
# gh-99064: The encoding declared in the document does not apply
10731073
# to a source which is already decoded.
10741074
def check(encoding, body):
1075-
xml = ("<?xml version='1.0' encoding='%s'?><xml>%s</xml>" %
1076-
(encoding, body))
1075+
xml = (f"<?xml version='1.0' encoding='{encoding}'?>"
1076+
f"<xml>{body}</xml>")
10771077
with self.subTest(encoding=encoding):
10781078
self.assertEqual(ET.parse(io.StringIO(xml)).getroot().text,
10791079
body)

0 commit comments

Comments
 (0)