##// END OF EJS Templates
merge separate input/expected notebooks for execute preprocessor
MinRK -
Show More
1 NO CONTENT: file renamed from IPython/nbconvert/preprocessors/tests/expected/Clear Output.ipynb to IPython/nbconvert/preprocessors/tests/files/Clear Output.ipynb
1 NO CONTENT: file renamed from IPython/nbconvert/preprocessors/tests/expected/Factorials.ipynb to IPython/nbconvert/preprocessors/tests/files/Factorials.ipynb
1 NO CONTENT: file renamed from IPython/nbconvert/preprocessors/tests/expected/HelloWorld.ipynb to IPython/nbconvert/preprocessors/tests/files/HelloWorld.ipynb
1 NO CONTENT: file renamed from IPython/nbconvert/preprocessors/tests/expected/Inline Image.ipynb to IPython/nbconvert/preprocessors/tests/files/Inline Image.ipynb
1 NO CONTENT: file renamed from IPython/nbconvert/preprocessors/tests/expected/SVG.ipynb to IPython/nbconvert/preprocessors/tests/files/SVG.ipynb
1 NO CONTENT: file renamed from IPython/nbconvert/preprocessors/tests/expected/Skip Exceptions.ipynb to IPython/nbconvert/preprocessors/tests/files/Skip Exceptions.ipynb
1 NO CONTENT: file renamed from IPython/nbconvert/preprocessors/tests/expected/Unicode.ipynb to IPython/nbconvert/preprocessors/tests/files/Unicode.ipynb
1 NO CONTENT: file renamed from IPython/nbconvert/preprocessors/tests/input/python.png to IPython/nbconvert/preprocessors/tests/files/python.png
@@ -6,6 +6,7 b' Module with tests for the execute preprocessor.'
6 6 # Distributed under the terms of the Modified BSD License.
7 7
8 8 import copy
9 import glob
9 10 import os
10 11 import re
11 12
@@ -16,7 +17,6 b' from ..execute import ExecutePreprocessor'
16 17
17 18 from IPython.nbconvert.filters import strip_ansi
18 19
19
20 20 addr_pat = re.compile(r'0x[0-9a-f]{7,9}')
21 21
22 22 class TestExecute(PreprocessorTestsBase):
@@ -71,16 +71,12 b' class TestExecute(PreprocessorTestsBase):'
71 71 def test_run_notebooks(self):
72 72 """Runs a series of test notebooks and compares them to their actual output"""
73 73 current_dir = os.path.dirname(__file__)
74 input_files = os.listdir(os.path.join(current_dir, 'input'))
74 input_files = glob.glob(os.path.join(current_dir, 'files', '*.ipynb'))
75 75 for filename in input_files:
76 if not filename.endswith(".ipynb"):
77 continue
78 with open(os.path.join(current_dir, 'input', filename)) as f:
76 with open(os.path.join(current_dir, 'files', filename)) as f:
79 77 input_nb = nbformat.read(f, 'ipynb')
80 with open(os.path.join(current_dir, 'expected', filename)) as f:
81 expected_nb = nbformat.read(f, 'ipynb')
82 78 res = self.build_resources()
83 79 preprocessor = self.build_preprocessor()
84 output_nb, _ = preprocessor(input_nb, res)
85 self.assert_notebooks_equal(output_nb, expected_nb)
80 output_nb, _ = preprocessor(copy.deepcopy(input_nb), res)
81 self.assert_notebooks_equal(output_nb, input_nb)
86 82
@@ -188,8 +188,7 b' def find_package_data():'
188 188 [
189 189 'tests/files/*.*',
190 190 'exporters/tests/files/*.*',
191 'preprocessors/tests/input/*.*',
192 'preprocessors/tests/expected/*.*',
191 'preprocessors/tests/files/*.*',
193 192 ],
194 193 'IPython.nbconvert.filters' : ['marked.js'],
195 194 'IPython.nbformat' : ['tests/*.ipynb','v3/v3.withref.json']
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now