python: more robust handling of %timeit in notebooks
* python/tests/ipnbdoctest.py: Simply ignore %timeit blocks.
This commit is contained in:
parent
6fb4df4359
commit
ff4837f4f2
1 changed files with 1 additions and 4 deletions
|
|
@ -70,9 +70,6 @@ def sanitize(s):
|
|||
# normalize graphviz version
|
||||
s = re.sub(r'Generated by graphviz version.*', 'VERSION', s)
|
||||
|
||||
# ignore %timeit results
|
||||
s = re.sub(r'^[0-9]+ loops, best of 3:.*per loop', '', s)
|
||||
|
||||
# SVG generated by graphviz may put note at different positions
|
||||
# depending on the graphviz build. Let's just strip anything that
|
||||
# look like a position.
|
||||
|
|
@ -214,7 +211,7 @@ def test_notebook(nb):
|
|||
errors = 0
|
||||
for ws in nb.worksheets:
|
||||
for i, cell in enumerate(ws.cells):
|
||||
if cell.cell_type != 'code':
|
||||
if cell.cell_type != 'code' or cell.input.startswith('%timeit'):
|
||||
continue
|
||||
try:
|
||||
outs = run_cell(kc, cell)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue