|
58 | 58 | " force_flags=None, # list of flags marking cells to always run\n", |
59 | 59 | " do_print=False, # print completion?\n", |
60 | 60 | " showerr=True, # print errors to stderr?\n", |
61 | | - " basepath=None): # path to add to sys.path\n", |
| 61 | + " basepath=None, # path to add to sys.path\n", |
| 62 | + " verbose=False): # stream stdout/stderr from cells to console?\n", |
62 | 63 | " \"Execute tests in notebook in `fn` except those with `skip_flags`\"\n", |
63 | 64 | " if basepath: sys.path.insert(0, str(basepath))\n", |
64 | 65 | " if not IN_NOTEBOOK: os.environ[\"IN_TEST\"] = '1'\n", |
|
79 | 80 | " if do_print: print(f'Starting {fn}')\n", |
80 | 81 | " try:\n", |
81 | 82 | " with working_directory(fn.parent):\n", |
82 | | - " k.run_all(nb, exc_stop=True, preproc=_no_eval)\n", |
| 83 | + " k.run_all(nb, exc_stop=True, preproc=_no_eval, verbose=verbose)\n", |
83 | 84 | " res = True\n", |
84 | 85 | " except: \n", |
85 | 86 | " if showerr: sys.stderr.write(k.prettytb(fname=fn)+'\\n')\n", |
|
170 | 171 | " do_print:bool=False, # Print start and end of each notebook\n", |
171 | 172 | " pause:float=0.01, # Pause time (in seconds) between notebooks to avoid race conditions\n", |
172 | 173 | " ignore_fname:str='.notest', # Filename that will result in siblings being ignored\n", |
| 174 | + " verbose:bool=False, # Print stdout/stderr from notebook cells?\n", |
173 | 175 | " **kwargs):\n", |
174 | 176 | " \"Test in parallel notebooks matching `path`, passing along `flags`\"\n", |
175 | 177 | " skip_flags = get_config().tst_flags\n", |
|
184 | 186 | " wd_pth = get_config().nbs_path\n", |
185 | 187 | " with working_directory(wd_pth if (wd_pth and wd_pth.exists()) else os.getcwd()):\n", |
186 | 188 | " results = parallel(test_nb, files, skip_flags=skip_flags, force_flags=force_flags, n_workers=n_workers,\n", |
187 | | - " basepath=get_config().config_path, pause=pause, do_print=do_print, **kw)\n", |
| 189 | + " basepath=get_config().config_path, pause=pause, do_print=do_print, verbose=verbose, **kw)\n", |
188 | 190 | " passed,times = zip(*results)\n", |
189 | 191 | " if all(passed): print(\"Success.\")\n", |
190 | 192 | " else: \n", |
|
0 commit comments