Skip to content

Commit 767e6ad

Browse files
[3.14] gh-141174: Test type_repr() of Template with invalid syntax in Interpolation (GH-155661) (#155712)
gh-141174: Test `type_repr()` of `Template` with invalid syntax in `Interpolation` (GH-155661) Test `type_repr()` of `Template` with invalid syntax in `Interpolation` (cherry picked from commit 5cc9e46) Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
1 parent 83197a5 commit 767e6ad

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
@@ -1874,6 +1874,10 @@ def nested():
18741874
type_repr(Template("hi", Interpolation(42, " "))),
18751875
"Template('hi', Interpolation(42, ' ', None, ''))",
18761876
)
1877+
self.assertEqual(
1878+
type_repr(Template("hi", Interpolation(42, "4!2"))),
1879+
"Template('hi', Interpolation(42, '4!2', None, ''))",
1880+
)
18771881
# gh138558: perhaps in the future, we can improve this behavior:
18781882
self.assertEqual(type_repr(Template(Interpolation(42, "99"))), "t'{99}'")
18791883

0 commit comments

Comments
 (0)