Skip to content

Commit 8c84081

Browse files
committed
fix tests
1 parent e1412e2 commit 8c84081

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

nbdev/doclinks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def _iter_py_cells(p):
6565
else:
6666
raise ValueError(f"Cell ID required but not found in '{p}' at:\n```\n# %% {top}\n```\n"
6767
"Run `nbdev_export` to regenerate .py files with cell IDs.")
68-
nb_path = None if nb=='auto' else (p.parent/nb).resolve() # NB paths are stored relative to .py file
68+
if nb=='auto': continue # Skip auto-generated __all__ cell
69+
nb_path = (p.parent/nb).resolve() # NB paths are stored relative to .py file
6970
if code.endswith('\n'): code=code[:-1]
7071
yield AttrDict(nb=nb, cell_id=cell_id, code=code, nb_path=nb_path, py_path=p.resolve())
7172

nbs/api/05_doclinks.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@
162162
" else:\n",
163163
" raise ValueError(f\"Cell ID required but not found in '{p}' at:\\n```\\n# %% {top}\\n```\\n\"\n",
164164
" \"Run `nbdev_export` to regenerate .py files with cell IDs.\")\n",
165-
" nb_path = None if nb=='auto' else (p.parent/nb).resolve() # NB paths are stored relative to .py file\n",
165+
" if nb=='auto': continue # Skip auto-generated __all__ cell\n",
166+
" nb_path = (p.parent/nb).resolve() # NB paths are stored relative to .py file\n",
166167
" if code.endswith('\\n'): code=code[:-1]\n",
167168
" yield AttrDict(nb=nb, cell_id=cell_id, code=code, nb_path=nb_path, py_path=p.resolve())"
168169
]
@@ -179,7 +180,7 @@
179180
"cell = next(it)\n",
180181
"test_eq(cell.nb, '../nbs/api/06_sync.ipynb')\n",
181182
"assert cell.cell_id, \"Cell should have an ID\"\n",
182-
"assert cell.code.startswith('from nbdev')"
183+
"assert cell.code.startswith('from .')"
183184
]
184185
},
185186
{

0 commit comments

Comments
 (0)