Skip to content

Commit f896e92

Browse files
authored
Merge pull request #1326 from fastai/fix-#1325
fix #1325
2 parents 693ad95 + 41e5551 commit f896e92

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

nbdev/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def nbdev_test(
8585
if n_workers is None: n_workers = 0 if len(files)==1 else min(num_cpus(), 8)
8686
if IN_NOTEBOOK: kw = {'method':'spawn'} if os.name=='nt' else {'method':'forkserver'}
8787
else: kw = {}
88-
with working_directory(get_config().nbs_path):
88+
wd_pth = get_config().nbs_path
89+
with working_directory(wd_pth if (wd_pth and wd_pth.exists()) else os.getcwd()):
8990
results = parallel(test_nb, files, skip_flags=skip_flags, force_flags=force_flags, n_workers=n_workers,
9091
basepath=get_config().config_path, pause=pause, do_print=do_print, **kw)
9192
passed,times = zip(*results)

nbs/api/12_test.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@
181181
" if n_workers is None: n_workers = 0 if len(files)==1 else min(num_cpus(), 8)\n",
182182
" if IN_NOTEBOOK: kw = {'method':'spawn'} if os.name=='nt' else {'method':'forkserver'}\n",
183183
" else: kw = {}\n",
184-
" with working_directory(get_config().nbs_path):\n",
184+
" wd_pth = get_config().nbs_path\n",
185+
" with working_directory(wd_pth if (wd_pth and wd_pth.exists()) else os.getcwd()):\n",
185186
" results = parallel(test_nb, files, skip_flags=skip_flags, force_flags=force_flags, n_workers=n_workers,\n",
186187
" basepath=get_config().config_path, pause=pause, do_print=do_print, **kw)\n",
187188
" passed,times = zip(*results)\n",

0 commit comments

Comments
 (0)