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

Method test_syntax_error_for_starred_expressions

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

Source from the content-addressed store, hash-verified

1717 f'{1:_,}'
1718
1719 def test_syntax_error_for_starred_expressions(self):
1720 with self.assertRaisesRegex(SyntaxError, "can't use starred expression here"):
1721 compile("f'{*a}'", "?", "exec")
1722
1723 with self.assertRaisesRegex(SyntaxError,
1724 "f-string: expecting a valid expression after '{'"):
1725 compile("f'{**a}'", "?", "exec")
1726
1727 def test_not_closing_quotes(self):
1728 self.assertAllRaise(SyntaxError, "unterminated f-string literal", ['f"', "f'"])

Callers

nothing calls this directly

Calls 2

assertRaisesRegexMethod · 0.95
compileFunction · 0.50

Tested by

no test coverage detected