Skip tests if libraries are not enabled

This commit is contained in:
Patrick Shriwise 2022-12-27 12:40:16 -06:00
parent 60a2a0e1f8
commit 251d7f5436
2 changed files with 7 additions and 0 deletions

View file

@ -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']

View file

@ -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