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