diff --git a/ltfatpy/tests/gabor/test_tfplot.py b/ltfatpy/tests/gabor/test_tfplot.py index bb26ca7b602dd4e668905cd98de88f3129b779d2..6a7b363cce8db97b3946e72c45777489df00822f 100644 --- a/ltfatpy/tests/gabor/test_tfplot.py +++ b/ltfatpy/tests/gabor/test_tfplot.py @@ -63,6 +63,7 @@ from __future__ import print_function, division import unittest import numpy as np from numpy.testing import assert_array_equal +import matplotlib.pyplot as plt from ltfatpy.gabor.tfplot import tfplot @@ -175,6 +176,11 @@ class TestTfplot(unittest.TestCase): def test_plot(self): """Check that the all the plotting sections of tfplot can be run """ + # NOTE: To avoid an error when running the tests in a environnement + # with no $DISPLAY variable defined, we switch matplotlib to a + # non-interactive backend + plt.switch_backend("ps") + coef = np.random.random((5, 4)) step = 1 yr = np.array([0., 1.])