Skip to content

Commit 5cc9e46

Browse files
authored
gh-141174: Test type_repr() of Template with invalid syntax in Interpolation (#155661)
Test `type_repr()` of `Template` with invalid syntax in `Interpolation`
1 parent 5d3f02a commit 5cc9e46

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_annotationlib.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,10 @@ def nested():
18811881
type_repr(Template("hi", Interpolation(42, " "))),
18821882
"Template('hi', Interpolation(42, ' ', None, ''))",
18831883
)
1884+
self.assertEqual(
1885+
type_repr(Template("hi", Interpolation(42, "4!2"))),
1886+
"Template('hi', Interpolation(42, '4!2', None, ''))",
1887+
)
18841888
# gh138558: perhaps in the future, we can improve this behavior:
18851889
self.assertEqual(type_repr(Template(Interpolation(42, "99"))), "t'{99}'")
18861890

0 commit comments

Comments
 (0)