Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
ff4837f4
Commit
ff4837f4
authored
Dec 26, 2015
by
Alexandre Duret-Lutz
Browse files
python: more robust handling of %timeit in notebooks
* python/tests/ipnbdoctest.py: Simply ignore %timeit blocks.
parent
6fb4df43
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/tests/ipnbdoctest.py
View file @
ff4837f4
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment