MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_ast_compile_time_concat

Method test_ast_compile_time_concat

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

assertEqualMethod · 0.95
compileFunction · 0.50
execFunction · 0.50
parseMethod · 0.45

Tested by

no test coverage detected