Skip to content
Snippets Groups Projects
Commit 22a7b357 authored by Florent Jaillet's avatar Florent Jaillet
Browse files

Forcing a non-interactive matplotlib backend in tests to solve issue #10

parent 06f4fbd6
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -63,6 +63,7 @@ from __future__ import print_function, division ...@@ -63,6 +63,7 @@ from __future__ import print_function, division
import unittest import unittest
import numpy as np import numpy as np
from numpy.testing import assert_array_equal from numpy.testing import assert_array_equal
import matplotlib.pyplot as plt
from ltfatpy.gabor.tfplot import tfplot from ltfatpy.gabor.tfplot import tfplot
...@@ -175,6 +176,11 @@ class TestTfplot(unittest.TestCase): ...@@ -175,6 +176,11 @@ class TestTfplot(unittest.TestCase):
def test_plot(self): def test_plot(self):
"""Check that the all the plotting sections of tfplot can be run """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)) coef = np.random.random((5, 4))
step = 1 step = 1
yr = np.array([0., 1.]) yr = np.array([0., 1.])
......
  • Florent Jaillet @florent.jaillet

    mentioned in issue #10 (closed)

    By Florent Jaillet on 2017-05-02T08:31:06 (imported from GitLab project)

    ·

    mentioned in issue #10 (closed)

    By Florent Jaillet on 2017-05-02T08:31:06 (imported from GitLab project)

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment