(tmp_path, writer, frame_format, output)
| 203 | |
| 204 | @pytest.mark.parametrize('writer, frame_format, output', gen_writers()) |
| 205 | def test_grabframe(tmp_path, writer, frame_format, output): |
| 206 | WriterClass = animation.writers[writer] |
| 207 | |
| 208 | if frame_format is not None: |
| 209 | plt.rcParams["animation.frame_format"] = frame_format |
| 210 | |
| 211 | fig, ax = plt.subplots() |
| 212 | |
| 213 | dpi = None |
| 214 | codec = None |
| 215 | if writer == 'ffmpeg': |
| 216 | # Issue #8253 |
| 217 | fig.set_size_inches((10.85, 9.21)) |
| 218 | dpi = 100. |
| 219 | codec = 'h264' |
| 220 | |
| 221 | test_writer = WriterClass() |
| 222 | with test_writer.saving(fig, tmp_path / output, dpi): |
| 223 | # smoke test it works |
| 224 | test_writer.grab_frame() |
| 225 | for k in {'dpi', 'bbox_inches', 'format'}: |
| 226 | with pytest.raises( |
| 227 | TypeError, |
| 228 | match=f"grab_frame got an unexpected keyword argument {k!r}"): |
| 229 | test_writer.grab_frame(**{k: object()}) |
| 230 | |
| 231 | |
| 232 | @pytest.mark.parametrize('writer', [ |
nothing calls this directly
no test coverage detected
searching dependent graphs…