From b65d79dd3e0727c9a809757589becd604e01bc90 Mon Sep 17 00:00:00 2001 From: Tobias Hangleiter Date: Fri, 3 Jul 2020 18:08:51 +0200 Subject: [PATCH] Catch exception during test discovery --- tests/test_extras.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_extras.py b/tests/test_extras.py index a04b596..1d3978d 100644 --- a/tests/test_extras.py +++ b/tests/test_extras.py @@ -55,7 +55,10 @@ def test_plotting_not_available(self): reason='Skipping tests for missing bloch sphere visualization tests in build with qutip') # noqa def test_bloch_sphere_visualization_not_available(self): - from filter_functions import plotting + try: + from filter_functions import plotting + except ModuleNotFoundError: + plotting = None with self.assertRaises(RuntimeError): plotting.get_bloch_vector(testutil.rng.standard_normal((10, 2)))