Skip to content

Commit f4912fb

Browse files
auto import IPython.display, change enumeration: only code cells are counting
1 parent 4bf2baf commit f4912fb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test_notebooks.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,17 @@ def test_notebook(self):
5252
# parse the string with nbformat.reads
5353
cells = nbformat.reads(content, 4)['cells']
5454

55+
# create namespace with IPython standards
5556
namespace = dict()
56-
for i, c in enumerate(cells):
57+
exec('from IPython import display', namespace)
58+
59+
# run all cells
60+
i = 0
61+
for c in cells:
5762

5863
# skip markdown cells
5964
if c['cell_type'] != 'code': continue
65+
i += 1
6066

6167
# skip deliberately failing cells
6268
if BOUND_TO_FAIL in c['source']: continue

0 commit comments

Comments
 (0)