@@ -51,14 +51,16 @@ def deploy(src):
5151 create_function (cfg , path_to_zip_file )
5252
5353
54- def invoke (src , alt_event = None ):
54+ def invoke (src , alt_event = None , verbose = False ):
5555 """Simulates a call to your function.
5656
5757 :param str src:
5858 The path to your Lambda ready project (folder must contain a valid
5959 config.yaml and handler module (e.g.: service.py).
6060 :param str alt_event:
6161 An optional argument to override which event file to use.
62+ :param bool verbose:
63+ Whether to print out verbose details.
6264 """
6365 # Load and parse the config file.
6466 path_to_config_file = os .path .join (src , 'config.yaml' )
@@ -78,15 +80,15 @@ def invoke(src, alt_event=None):
7880
7981 # TODO: look into mocking the ``context`` variable, currently being passed
8082 # as None.
83+
8184 start = time .time ()
8285 results = fn (event , None )
8386 end = time .time ()
84- elapsed = end - start
85- timeout = cfg .get ('timeout' , 15 )
8687
8788 print ("{0}" .format (results ))
88- print ("\n execution time: {:.8f}s\n function execution "
89- "timeout: {:2}s" .format (elapsed , timeout ))
89+ if verbose :
90+ print ("\n execution time: {:.8f}s\n function execution "
91+ "timeout: {:2}s" .format (end - start , cfg .get ('timeout' , 15 )))
9092
9193
9294def init (src , minimal = False ):
0 commit comments