MCPcopy Index your code
hub / github.com/python/cpython / test_ast_compile_time_concat

Method test_ast_compile_time_concat

Lib/test/test_fstring.py:580–587  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

578 ast.literal_eval("f'x'")
579
580 def test_ast_compile_time_concat(self):
581 x = ['']
582
583 expr = """x[0] = 'foo' f'{3}'"""
584 t = ast.parse(expr)
585 c = compile(t, '', 'exec')
586 exec(c)
587 self.assertEqual(x[0], 'foo3')
588
589 def test_compile_time_concat_errors(self):
590 self.assertAllRaise(SyntaxError,

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.95
compileFunction · 0.50
parseMethod · 0.45

Tested by

no test coverage detected