@@ -95,7 +95,7 @@ def test_preprocessor_svg2pdf():
95
95
def test_preprocessor_embedimages ():
96
96
"""Test python embedimages preprocessor."""
97
97
# check import shortcut
98
- from jupyter_contrib_nbextensions .nbconvert_support import EmbedImagesPreprocessor # noqa E501
98
+ from jupyter_contrib_nbextensions .nbconvert_support import EmbedImagesPreprocessor # noqa E501
99
99
notebook_node = nbf .new_notebook (cells = [
100
100
nbf .new_code_cell (source = "a = 'world'" ),
101
101
nbf .new_markdown_cell (
@@ -110,13 +110,14 @@ def test_preprocessor_embedimages():
110
110
expected = 'image/png'
111
111
assert_in (expected , body , 'Attachment {} is missing' .format (expected ))
112
112
113
+
113
114
def test_preprocessor_embedimages_resize ():
114
115
"""Test python embedimages preprocessor."""
115
116
# check import shortcut
116
- from jupyter_contrib_nbextensions .nbconvert_support import EmbedImagesPreprocessor # noqa E501
117
+ from jupyter_contrib_nbextensions .nbconvert_support import EmbedImagesPreprocessor # noqa E501
117
118
118
119
try :
119
- from PIL import Image
120
+ from PIL import Image # noqa F401
120
121
except ImportError :
121
122
raise SkipTest ('PIL not found' )
122
123
@@ -130,25 +131,27 @@ def test_preprocessor_embedimages_resize():
130
131
notebook_node , EmbedImagesPreprocessor , NotebookExporter , 'ipynb' )
131
132
len_noembed = len (body )
132
133
133
- customconfig = Config (EmbedImagesPreprocessor = {'embed_images' : True , 'resize' : 'small' })
134
+ customconfig = Config (EmbedImagesPreprocessor = {'embed_images' : True ,
135
+ 'resize' : 'small' })
134
136
body , resources = export_through_preprocessor (
135
137
notebook_node , EmbedImagesPreprocessor , NotebookExporter , 'ipynb' ,
136
138
customconfig )
137
139
len_small = len (body )
138
140
139
- customconfig = Config (EmbedImagesPreprocessor = {'embed_images' : True , 'resize' : 'mid' })
141
+ customconfig = Config (EmbedImagesPreprocessor = {'embed_images' : True ,
142
+ 'resize' : 'mid' })
140
143
body , resources = export_through_preprocessor (
141
144
notebook_node , EmbedImagesPreprocessor , NotebookExporter , 'ipynb' ,
142
145
customconfig )
143
146
len_mid = len (body )
144
147
145
- customconfig = Config (EmbedImagesPreprocessor = {'embed_images' : True , 'resize' : 'large' })
148
+ customconfig = Config (EmbedImagesPreprocessor = {'embed_images' : True ,
149
+ 'resize' : 'large' })
146
150
body , resources = export_through_preprocessor (
147
151
notebook_node , EmbedImagesPreprocessor , NotebookExporter , 'ipynb' ,
148
152
customconfig )
149
153
len_large = len (body )
150
154
151
-
152
155
customconfig = Config (EmbedImagesPreprocessor = {'embed_images' : True })
153
156
body , resources = export_through_preprocessor (
154
157
notebook_node , EmbedImagesPreprocessor , NotebookExporter , 'ipynb' ,
0 commit comments