Skip to content

Commit

Permalink
added try-catch block to test_animation to deal with strange
Browse files Browse the repository at this point in the history
import errors coming out of numpy.  See issue matplotlib#1891.
  • Loading branch information
tacaswell committed Dec 19, 2013
1 parent cca8256 commit 61bce5d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/matplotlib/tests/test_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@

import six

import os
import tempfile

import numpy as np
from nose import with_setup
from matplotlib import pyplot as plt
from matplotlib import animation
from matplotlib.testing.noseclasses import KnownFailureTest
from matplotlib.testing.decorators import cleanup
from matplotlib.testing.decorators import CleanupTest


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


if __name__ == "__main__":
Expand Down

0 comments on commit 61bce5d

Please sign in to comment.