summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2018-09-28 15:50:34 +0200
committerRémi Flamary <remi.flamary@gmail.com>2018-09-28 15:50:34 +0200
commiteaa05d1411cc8b365479fb239acf4e774c68037c (patch)
treeaba61e2ce2a92243683534cdd076ec8ad5faae8d /test
parent49af12288b4a6e45d1ff85f3e39d8d76839b2d5f (diff)
cleanup tests with plot
Diffstat (limited to 'test')
-rw-r--r--test/test_plot.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/test_plot.py b/test/test_plot.py
index f77d879..caf84de 100644
--- a/test/test_plot.py
+++ b/test/test_plot.py
@@ -5,10 +5,18 @@
# License: MIT License
import numpy as np
-import matplotlib
-matplotlib.use('Agg')
+import pytest
+try: # test if matplotlib is installed
+ import matplotlib
+ matplotlib.use('Agg')
+ nogo = False
+except ImportError:
+ nogo = True
+
+
+@pytest.mark.skipif(nogo, reason="Matplotlib not installed")
def test_plot1D_mat():
import ot
@@ -30,6 +38,7 @@ def test_plot1D_mat():
ot.plot.plot1D_mat(a, b, M, 'Cost matrix M')
+@pytest.mark.skipif(nogo, reason="Matplotlib not installed")
def test_plot2D_samples_mat():
import ot