File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 2121__all__ = [
2222 'perform_sequence' ,
2323 'SequenceDispatcher' ,
24- 'EQDispatcher' ,
25- 'EQFDispatcher' ,
24+ 'noop' ,
2625 'resolve_effect' ,
2726 'fail_effect' ,
27+ 'EQDispatcher' ,
28+ 'EQFDispatcher' ,
2829 'Stub' ,
2930 'ESConstant' , 'ESError' , 'ESFunc' ,
3031 'resolve_stubs' ,
@@ -453,3 +454,20 @@ def consume(self):
453454 raise AssertionError (
454455 "Not all intents were performed: {0}" .format (
455456 [x [0 ] for x in self .sequence ]))
457+
458+
459+ def noop (intent ):
460+ """
461+
462+ Return None. This is just a handy way to make your intent sequences (as
463+ used by :func:`perform_sequence`) more concise when the effects you're
464+ expecting in a test don't return a result (and are instead only performed
465+ for their side-effects)::
466+
467+ seq = [
468+ (Prompt('Enter your name: '), lambda i: 'Chris')
469+ (Greet('Chris'), noop),
470+ ]
471+
472+ """
473+ return None
You can’t perform that action at this time.
0 commit comments