From eaa05d1411cc8b365479fb239acf4e774c68037c Mon Sep 17 00:00:00 2001 From: RĂ©mi Flamary Date: Fri, 28 Sep 2018 15:50:34 +0200 Subject: cleanup tests with plot --- test/test_plot.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'test/test_plot.py') 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 -- cgit v1.2.3