10000 Create a simple tester that executes the notebooks · ueg1990/github3.py@f3aafe7 · GitHub
[go: up one dir, main page]

Skip to content

Commit f3aafe7

Browse files
committed
Create a simple tester that executes the notebooks
1 parent f1ab4ea commit f3aafe7

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

tests/nbtest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import glob
5+
6+
from IPython.config import Config
7+
from IPython.nbconvert import HTMLExporter
8+
9+
c = Config({
10+
'ExecutePreprocessor': {'enabled': True}
11+
})
12+
13+
exporter = HTMLExporter(config=c)
14+
15+
for filename in glob.glob("example-notebooks/*.ipynb"):
16+
print(filename)
17+
exporter.from_filename(filename)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ commands = flake8 {posargs} github3/
2424
basepython = python3.4
2525
deps =
2626
ipython[notebook]
27-
commands = find example-notebooks -name '*.ipynb' -exec ipython nbconvert --to notebook \{\} --output /dev/null --execute \;
27+
commands = python tests/nbtest.py
2828

2929
[testenv:docstrings]
3030
deps =

0 commit comments

Comments
 (0)
0