Skip to content

Commit 61bce5d

Browse files
committed
added try-catch block to test_animation to deal with strange
import errors coming out of numpy. See issue matplotlib#1891.
1 parent cca8256 commit 61bce5d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/matplotlib/tests/test_animation.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33

44
import six
55

6-
import os
76
import tempfile
87

98
import numpy as np
109
from nose import with_setup
1110
from matplotlib import pyplot as plt
1211
from matplotlib import animation
1312
from matplotlib.testing.noseclasses import KnownFailureTest
14-
from matplotlib.testing.decorators import cleanup
1513
from matplotlib.testing.decorators import CleanupTest
1614

1715

@@ -52,7 +50,12 @@ def animate(i):
5250
# Use NamedTemporaryFile: will be automatically deleted
5351
F = tempfile.NamedTemporaryFile(suffix='.' + extension)
5452
anim = animation.FuncAnimation(fig, animate, init_func=init, frames=5)
55-
anim.save(F.name, fps=30, writer=writer)
53+
try:
54+
anim.save(F.name, fps=30, writer=writer)
55+
except UnicodeDecodeError:
56+
raise KnownFailureTest("There can be errors in the numpy " +
57+
"import stack, " +
58+
"see issues #1891 and #2679")
5659

5760

5861
if __name__ == "__main__":

0 commit comments

Comments
 (0)