File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change 1- from enum import Enum , StrEnum
1+ from enum import Enum
22from unittest import TestCase , skipIf
33
44from transitions .core import Machine
@@ -398,17 +398,23 @@ class States(enum.Enum):
398398 self .assertEqual (ref_state , m .state )
399399
400400
401- class TestNestedStateStrEnums (TestNestedStateEnums ):
401+ try :
402+ from enum import StrEnum
402403
403- def setUp (self ):
404- super ().setUp ()
404+ class TestNestedStateStrEnums (TestNestedStateEnums ):
405+
406+ def setUp (self ):
407+ super ().setUp ()
405408
406- class States (StrEnum ):
407- RED = "red"
408- YELLOW = "yellow"
409- GREEN = "green"
409+ class States (StrEnum ):
410+ RED = "red"
411+ YELLOW = "yellow"
412+ GREEN = "green"
410413
411- self .States = States
414+ self .States = States
415+
416+ except ImportError :
417+ pass # Python < 3.11 does not have StrEnum
412418
413419
414420@skipIf (enum is None or (pgv is None and gv is None ), "enum and (py)graphviz are not available" )
You can’t perform that action at this time.
0 commit comments