From 251d7f5436d9a85255ea95b85dd844a300bdc367 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 27 Dec 2022 12:40:16 -0600 Subject: [PATCH] Skip tests if libraries are not enabled --- .../unstructured_mesh/source_sampling/test.py | 6 ++++++ tests/unit_tests/test_source_mesh.py | 1 + 2 files changed, 7 insertions(+) diff --git a/tests/regression_tests/unstructured_mesh/source_sampling/test.py b/tests/regression_tests/unstructured_mesh/source_sampling/test.py index 83458e4405..81f552698b 100644 --- a/tests/regression_tests/unstructured_mesh/source_sampling/test.py +++ b/tests/regression_tests/unstructured_mesh/source_sampling/test.py @@ -81,6 +81,12 @@ for i, lib, in enumerate(['libmesh', 'moab']): @pytest.mark.parametrize("test_cases", test_cases, ids=lambda p: p['library']) def test_unstructured_mesh_sampling(model, test_cases): + # skip the test if the library is not enabled + if test_cases['library'] == 'moab' and not openmc.lib._dagmc_enabled(): + pytest.skip("DAGMC (and MOAB) mesh not enabled in this build.") + + if test_cases['library'] == 'libmesh' and not openmc.lib._libmesh_enabled(): + pytest.skip("LibMesh is not enabled in this build.") model.settings.source[0].space.mesh.libaray = test_cases['library'] diff --git a/tests/unit_tests/test_source_mesh.py b/tests/unit_tests/test_source_mesh.py index 6549734e86..f093d54d65 100644 --- a/tests/unit_tests/test_source_mesh.py +++ b/tests/unit_tests/test_source_mesh.py @@ -11,6 +11,7 @@ from tests import cdtemp from tests.regression_tests import config from subprocess import call + TETS_PER_VOXEL = 12 # This test uses a geometry file with cells that match a regular mesh. Each cell