Skip to content

Commit e0c002c

Browse files
committed
Add test for setup dpi default.
1 parent 3026bbd commit e0c002c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/matplotlib/tests/test_animation.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,26 @@ def animate(i):
7474
assert writer._count == num_frames
7575

7676

77+
def test_movie_writer_dpi_default():
78+
# Test setting up movie writer with figure.dpi default.
79+
80+
fig = plt.figure()
81+
82+
filename = "unused.null"
83+
fps = 5
84+
codec = "unused"
85+
bitrate = 1
86+
extra_args = ["unused"]
87+
88+
def run():
89+
pass
90+
91+
writer = animation.MovieWriter(fps, codec, bitrate, extra_args)
92+
writer._run = run
93+
writer.setup(fig, filename)
94+
assert writer.dpi == fig.dpi
95+
96+
7797
@animation.writers.register('null')
7898
class RegisteredNullMovieWriter(NullMovieWriter):
7999

0 commit comments

Comments
 (0)