File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -160,8 +160,9 @@ def test_template_concatenation(self):
160160
161161 # Test template + string
162162 t1 = t "Hello"
163- expected_msg = 'can only concatenate Template (not "str") to Template'
164- with self .assertRaises (TypeError , msg = expected_msg ):
163+ expected_msg = 'can only concatenate string.templatelib.Template ' \
164+ '\\ (not "str"\\ ) to string.templatelib.Template'
165+ with self .assertRaisesRegex (TypeError , expected_msg ):
165166 t1 + ", world"
166167
167168 # Test template + template with interpolation
@@ -173,8 +174,9 @@ def test_template_concatenation(self):
173174 self .assertEqual (fstring (combined ), "Hello, Python" )
174175
175176 # Test string + template
176- expected_msg = 'can only concatenate str (not "string.templatelib.Template") to str'
177- with self .assertRaises (TypeError , msg = expected_msg ):
177+ expected_msg = 'can only concatenate str ' \
178+ '\\ (not "string.templatelib.Template"\\ ) to str'
179+ with self .assertRaisesRegex (TypeError , expected_msg ):
178180 "Hello, " + t "{name}"
179181
180182 def test_nested_templates (self ):
You can’t perform that action at this time.
0 commit comments