diff --git a/tests/unit_tests/test_capi.py b/tests/unit_tests/test_capi.py index af013cbb5b..d6b59423ff 100644 --- a/tests/unit_tests/test_capi.py +++ b/tests/unit_tests/test_capi.py @@ -49,7 +49,13 @@ def capi_init(pincell_model): @pytest.fixture(scope='module') -def capi_run(capi_init): +def capi_simulation_init(pincell_model): + openmc.capi.simulation_init() + yield + + +@pytest.fixture(scope='module') +def capi_run(capi_simulation_init): openmc.capi.run() @@ -173,10 +179,6 @@ def test_tally(capi_init): t.scores = new_scores assert t.scores == new_scores - assert not t.active - t.active = True - assert t.active - t2 = openmc.capi.tallies[2] t2.id = 2 assert len(t2.filters) == 2 @@ -196,6 +198,13 @@ def test_new_tally(capi_init): assert len(openmc.capi.tallies) == 4 +def test_tally_activate(capi_simulation_init): + t = openmc.capi.tallies[1] + assert not t.active + t.active = True + assert t.active + + def test_tally_results(capi_run): t = openmc.capi.tallies[1] assert t.num_realizations == 10 # t was made active in test_tally