@@ -249,18 +249,27 @@ def test_literal_concatenation(self):
249249 "t'{what}-string literal' f'f-string literal'" ,
250250 "t'{what}-string literal' r'raw string literal'" ,
251251 "t'{what}-string literal' rf'raw f-string literal'" ,
252+ "'str literal' t'{what}-string literal'" ,
253+ "u'unicode literal' t'{what}-string literal'" ,
254+ "f'f-string literal' t'{what}-string literal'" ,
255+ "r'raw string literal' t'{what}-string literal'" ,
256+ "rf'raw f-string literal' t'{what}-string literal'" ,
252257 ):
253- with self .assertRaisesRegex (SyntaxError , expected_msg ):
254- eval (case )
258+ with self .subTest (case ):
259+ with self .assertRaisesRegex (SyntaxError , expected_msg ):
260+ eval (case )
255261
256262 # Test disallowed mix of t-string and bytes
257263 expected_msg = 'cannot mix bytes and nonbytes literals'
258264 for case in (
259265 "t'{what}-string literal' b'bytes literal'" ,
260266 "t'{what}-string literal' br'raw bytes literal'" ,
267+ "b'bytes literal' t'{what}-string literal'" ,
268+ "br'raw bytes literal' t'{what}-string literal'" ,
261269 ):
262- with self .assertRaisesRegex (SyntaxError , expected_msg ):
263- eval (case )
270+ with self .subTest (case ):
271+ with self .assertRaisesRegex (SyntaxError , expected_msg ):
272+ eval (case )
264273
265274 def test_triple_quoted (self ):
266275 # Test triple-quoted t-strings
0 commit comments