Skip to content

Commit 3d3f0c2

Browse files
committed
spelling and formatting
1 parent 924371b commit 3d3f0c2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

tests/test_core.py

+1
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ def test_internal_transition(self):
947947
self.assertEqual(m.model.state, 'A')
948948
self.assertEqual(m.model.level, 2)
949949

950+
950951
class TestWarnings(TestCase):
951952

952953
def test_warning(self):

tests/test_nesting.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,14 @@ def test_get_triggers(self):
506506
self.assertEqual(len(trans), 3)
507507
self.assertTrue('relax' in trans)
508508

509-
def test_internal_trantisions(self):
509+
def test_internal_transitions(self):
510510
s = self.stuff
511511
s.machine.add_transition('internal', 'A', None, prepare='increase_level')
512512
s.internal()
513513
self.assertEqual(s.state, 'A')
514514
self.assertEqual(s.level, 2)
515515

516+
516517
@skipIf(pgv is None, 'AGraph diagram requires pygraphviz')
517518
class TestWithGraphTransitions(TestTransitions):
518519

transitions/core.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def execute(self, event_data):
267267
return True
268268

269269
def _change_state(self, event_data):
270-
if self.dest:
270+
if self.dest: # if self.dest is None this is an internal transition with no actual state change
271271
event_data.machine.get_state(self.source).exit(event_data)
272272
event_data.machine.set_state(self.dest, event_data.model)
273273
event_data.update(event_data.model)
@@ -813,7 +813,7 @@ def add_transition(self, trigger, source, dest, conditions=None,
813813
equal sign to specify that the transition should be reflexive
814814
so that the destination will be the same as the source for
815815
every given source. If dest is None, this transition will be
816-
an internal transition.
816+
an internal transition (exit/enter callbacks won't be processed).
817817
conditions (string or list): Condition(s) that must pass in order
818818
for the transition to take place. Either a list providing the
819819
name of a callable, or a list of callables. For the transition

0 commit comments

Comments
 (0)