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

Method test_repeated_rules

Lib/test/test_peg_generator/test_pegen.py:45–52  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

43 self.assertEqual(repr(rules["term"]), expected_repr)
44
45 def test_repeated_rules(self) -> None:
46 grammar_source = """
47 start: the_rule NEWLINE
48 the_rule: 'b' NEWLINE
49 the_rule: 'a' NEWLINE
50 """
51 with self.assertRaisesRegex(GrammarError, "Repeated rule 'the_rule'"):
52 parse_string(grammar_source, GrammarParser)
53
54 def test_long_rule_str(self) -> None:
55 grammar_source = """

Callers

nothing calls this directly

Calls 2

parse_stringFunction · 0.90
assertRaisesRegexMethod · 0.80

Tested by

no test coverage detected