From 1a15233d847676fc1a0caeafb1d475687bb08812 Mon Sep 17 00:00:00 2001 From: Martin Bauer <martin.bauer@fau.de> Date: Thu, 16 Jan 2020 10:55:35 +0100 Subject: [PATCH] Fix for pytest importorskip introduced in 2659b514 - test_serial_scenarios already tested if waLBerla is available by catching ImportErrors - importorskip from pytest throws another exception, which is not part of the public API -> catching all exceptions - which is not really elegant but works --- lbmpy_tests/test_serial_scenarios.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lbmpy_tests/test_serial_scenarios.py b/lbmpy_tests/test_serial_scenarios.py index 024166e1..62452b03 100644 --- a/lbmpy_tests/test_serial_scenarios.py +++ b/lbmpy_tests/test_serial_scenarios.py @@ -134,7 +134,7 @@ def compare_lid_driven_cavity(optimization=MappingProxyType({}), action='Testing try: from lbmpy_tests.walberla_scenario_setup import create_lid_driven_cavity as run_lid_driven_cavity_walberla - except ImportError: + except Exception: run_lid_driven_cavity_walberla = None return compare_scenario(run_ldc_lbmpy, run_lid_driven_cavity_walberla, optimization, action, name, plot, **kwargs) @@ -152,7 +152,7 @@ def compare_force_driven_channel(optimization=MappingProxyType({}), action='Test try: from lbmpy_tests.walberla_scenario_setup import create_lid_driven_cavity as run_force_driven_channel_walberla - except ImportError: + except Exception: run_force_driven_channel_walberla = None return compare_scenario(lbmpy_func, run_force_driven_channel_walberla, optimization, action, name, plot, **kwargs) -- GitLab