Skip to content
Snippets Groups Projects
Commit 8f096237 authored by Ian Cordasco's avatar Ian Cordasco
Browse files

Use the IPython ExecutePreprocessor in tests

parent 48adfa8a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -2,16 +2,23 @@
# -*- coding: utf-8 -*-
 
import glob
import json
 
from IPython.config import Config
from IPython.nbconvert import ExecutePreprocessor
from IPython.nbconvert import HTMLExporter
from IPython.nbformat import NotebookNode
 
c = Config({
'ExecutePreprocessor': {'enabled': True}
'ExecutePreprocessor': {'enabled': True}
})
 
exporter = HTMLExporter(config=c)
executor = ExecutePreprocessor(config=c)
 
for filename in glob.glob("example-notebooks/*.ipynb"):
print(filename)
exporter.from_filename(filename)
print(filename)
exporter.from_filename(filename)
with open(filename, 'r') as file:
node = NotebookNode(json.load(file))
executor.preprocess(node, {})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment