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

Method test_mismatched_parens

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

Source from the content-addressed store, hash-verified

608
609 @unittest.skipIf(support.is_wasi, "exhausts limited stack on WASI")
610 def test_mismatched_parens(self):
611 self.assertAllRaise(SyntaxError, r"closing parenthesis '\}' "
612 r"does not match opening parenthesis '\('",
613 ["f'{((}'",
614 ])
615 self.assertAllRaise(SyntaxError, r"closing parenthesis '\)' "
616 r"does not match opening parenthesis '\['",
617 ["f'{a[4)}'",
618 ])
619 self.assertAllRaise(SyntaxError, r"closing parenthesis '\]' "
620 r"does not match opening parenthesis '\('",
621 ["f'{a(4]}'",
622 ])
623 self.assertAllRaise(SyntaxError, r"closing parenthesis '\}' "
624 r"does not match opening parenthesis '\['",
625 ["f'{a[4}'",
626 ])
627 self.assertAllRaise(SyntaxError, r"closing parenthesis '\}' "
628 r"does not match opening parenthesis '\('",
629 ["f'{a(4}'",
630 ])
631 self.assertRaises(SyntaxError, eval, "f'{" + "("*20 + "}'")
632
633 @unittest.skipIf(support.is_wasi, "exhausts limited stack on WASI")
634 def test_fstring_nested_too_deeply(self):

Callers

nothing calls this directly

Calls 2

assertAllRaiseMethod · 0.95
assertRaisesMethod · 0.95

Tested by

no test coverage detected