@@ -141,19 +141,31 @@ def isAvailable(cls):
141
141
('html' , 'movie.html' ),
142
142
('null' , 'movie.null' )
143
143
]
144
- WRITER_OUTPUT += [
145
- (writer , Path (output )) for writer , output in WRITER_OUTPUT ]
144
+
145
+
146
+ def gen_writers ():
147
+ for writer , output in WRITER_OUTPUT :
148
+ if not animation .writers .is_available (writer ):
149
+ mark = pytest .mark .skip (
150
+ f"writer '{ writer } ' not available on this system" )
151
+ yield pytest .param (writer , None , output , marks = [mark ])
152
+ yield pytest .param (writer , None , Path (output ), marks = [mark ])
153
+ continue
154
+
155
+ writer_class = animation .writers [writer ]
156
+ for frame_format in getattr (writer_class , 'supported_formats' , [None ]):
157
+ yield writer , frame_format , output
158
+ yield writer , frame_format , Path (output )
146
159
147
160
148
161
# Smoke test for saving animations. In the future, we should probably
149
162
# design more sophisticated tests which compare resulting frames a-la
150
163
# matplotlib.testing.image_comparison
151
- @pytest .mark .parametrize ('writer, output' , WRITER_OUTPUT )
164
+ @pytest .mark .parametrize ('writer, frame_format, output' , gen_writers () )
152
165
@pytest .mark .parametrize ('anim' , [dict (klass = dict )], indirect = ['anim' ])
153
- def test_save_animation_smoketest (tmpdir , writer , output , anim ):
154
- if not animation .writers .is_available (writer ):
155
- pytest .skip ("writer '%s' not available on this system" % writer )
156
-
166
+ def test_save_animation_smoketest (tmpdir , writer , frame_format , output , anim ):
167
+ if frame_format is not None :
168
+ plt .rcParams ["animation.frame_format" ] = frame_format
157
169
anim = animation .FuncAnimation (** anim )
158
170
dpi = None
159
171
codec = None
0 commit comments