From 1da96b2fa6b0290c0b767dd27d393d547310027f Mon Sep 17 00:00:00 2001 From: shriwise Date: Tue, 11 Sep 2018 08:28:56 -0500 Subject: [PATCH] Adding a test harness class to make sure threads are set correctly in CI. --- tests/testing_harness.py | 9 +++++++++ tests/unit_tests/cad/test_cad.py | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/testing_harness.py b/tests/testing_harness.py index fb07575ce7..912bbb6f40 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -312,3 +312,12 @@ class HashedPyAPITestHarness(PyAPITestHarness): def _get_results(self): """Digest info in the statepoint and return as a string.""" return super()._get_results(True) + + +class CADTestHarness(TestHarness): + + def __init__(self, statepoint_name): + super(TestHarness, self).__init__(statepoint_name) + + def _run_openmc(self): + openmc.run(openmc_exec=config['exe'], threads = 1) diff --git a/tests/unit_tests/cad/test_cad.py b/tests/unit_tests/cad/test_cad.py index 4b5ae34cf9..4eb44aac24 100644 --- a/tests/unit_tests/cad/test_cad.py +++ b/tests/unit_tests/cad/test_cad.py @@ -1,4 +1,4 @@ -from tests.testing_harness import TestHarness +from tests.testing_harness import CADTestHarness import pytest pytestmark = pytest.mark.skipif( @@ -6,5 +6,5 @@ pytestmark = pytest.mark.skipif( reason="CAD build is not enabled.") def test_cad(): - harness = TestHarness('statepoint.15.h5') + harness = CADTestHarness('statepoint.15.h5') harness.main()