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

Method test_parens_in_expressions

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

Source from the content-addressed store, hash-verified

928 ])
929
930 def test_parens_in_expressions(self):
931 self.assertEqual(f'{3,}', '(3,)')
932
933 self.assertAllRaise(SyntaxError,
934 "f-string: expecting a valid expression after '{'",
935 ["f'{,}'",
936 ])
937
938 self.assertAllRaise(SyntaxError, r"f-string: unmatched '\)'",
939 ["f'{3)+(4}'",
940 ])
941
942 def test_newlines_before_syntax_error(self):
943 self.assertAllRaise(SyntaxError,

Callers

nothing calls this directly

Calls 2

assertEqualMethod · 0.95
assertAllRaiseMethod · 0.95

Tested by

no test coverage detected