From 3e505ca1ad4389eeaead88489f64c131ea15ed58 Mon Sep 17 00:00:00 2001 From: Helen G Scott Date: Fri, 3 Nov 2023 14:26:18 -0400 Subject: [PATCH] Add explicit exceptions Co-authored-by: Moritz E. Beber --- src/memote/suite/tests/test_consistency.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/memote/suite/tests/test_consistency.py b/src/memote/suite/tests/test_consistency.py index 1d4b4698..6e4548a4 100644 --- a/src/memote/suite/tests/test_consistency.py +++ b/src/memote/suite/tests/test_consistency.py @@ -158,7 +158,9 @@ def test_detect_energy_generating_cycles(model, met): main_comp = helpers.find_compartment_id_in_model(model, "c") try: helpers.find_met_in_model(model, met, main_comp)[0] - except: + except ValueError: + pytest.skip("Metabolite {} is not in the MetaNetX shortlist.".format(met)) + except (RuntimeError, IndexError): pytest.skip( "This test has been skipped since metabolite {} could " "not be found in the model.".format(met)