CYCAMORE
Loading...
Searching...
No Matches
test_run_inputs.py
Go to the documentation of this file.
1import os
2import subprocess
3
4from pytest import skip
5import pytest
6
7import run_inputs as ri
8from helper import cyclus_has_coin
9
10
11def coin_skipper(filename):
12 raise skip(filename + " cannot be executed since Cyclus was not installed "
13 "with COIN support")
14
16 files, _, _ = ri.get_files(ri.input_path)
17 for f in files:
18 yield f
19
20@pytest.fixture(params=get_files())
21def file_fixture(request):
22 return request.param
23
24def test_inputs(file_fixture):
25 absfile = os.path.join(ri.input_path, file_fixture)
26 with open(absfile) as fh:
27 src = fh.read()
28 if cyclus_has_coin() or "GrowthRegion" not in src:
29 testf = ri.TestFile(ri.cyclus_path, file_fixture, "-v0")
30 testf.run()
31 assert testf.passed, "Failed running {}".format(file_fixture)
32 else:
33 coin_skipper(absfile)
test_inputs(file_fixture)
coin_skipper(filename)