|
1 | 1 | import ast |
2 | 2 | import builtins |
3 | 3 | import dis |
4 | | -import enum |
5 | 4 | import os |
6 | 5 | import sys |
7 | 6 | import types |
@@ -699,35 +698,6 @@ def test_constant_as_name(self): |
699 | 698 | with self.assertRaisesRegex(ValueError, f"Name node can't be used with '{constant}' constant"): |
700 | 699 | compile(expr, "<test>", "eval") |
701 | 700 |
|
702 | | - def test_precedence_enum(self): |
703 | | - class _Precedence(enum.IntEnum): |
704 | | - """Precedence table that originated from python grammar.""" |
705 | | - TUPLE = enum.auto() |
706 | | - YIELD = enum.auto() # 'yield', 'yield from' |
707 | | - TEST = enum.auto() # 'if'-'else', 'lambda' |
708 | | - OR = enum.auto() # 'or' |
709 | | - AND = enum.auto() # 'and' |
710 | | - NOT = enum.auto() # 'not' |
711 | | - CMP = enum.auto() # '<', '>', '==', '>=', '<=', '!=', |
712 | | - # 'in', 'not in', 'is', 'is not' |
713 | | - EXPR = enum.auto() |
714 | | - BOR = EXPR # '|' |
715 | | - BXOR = enum.auto() # '^' |
716 | | - BAND = enum.auto() # '&' |
717 | | - SHIFT = enum.auto() # '<<', '>>' |
718 | | - ARITH = enum.auto() # '+', '-' |
719 | | - TERM = enum.auto() # '*', '@', '/', '%', '//' |
720 | | - FACTOR = enum.auto() # unary '+', '-', '~' |
721 | | - POWER = enum.auto() # '**' |
722 | | - AWAIT = enum.auto() # 'await' |
723 | | - ATOM = enum.auto() |
724 | | - def next(self): |
725 | | - try: |
726 | | - return self.__class__(self + 1) |
727 | | - except ValueError: |
728 | | - return self |
729 | | - enum._test_simple_enum(_Precedence, ast._Precedence) |
730 | | - |
731 | 701 |
|
732 | 702 | class ASTHelpers_Test(unittest.TestCase): |
733 | 703 | maxDiff = None |
|
0 commit comments