CYCAMORE
Loading...
Searching...
No Matches
test_run_inputs.py
Go to the documentation of this file.
1
import
os
2
import
subprocess
3
4
from
pytest
import
skip
5
import
pytest
6
7
import
run_inputs
as
ri
8
from
helper
import
cyclus_has_coin
9
10
11
def
coin_skipper
(filename):
12
raise
skip(filename +
" cannot be executed since Cyclus was not installed "
13
"with COIN support"
)
14
15
def
get_files
():
16
files, _, _ = ri.get_files(ri.input_path)
17
for
f
in
files:
18
yield
f
19
20
@pytest.fixture(params=get_files()
)
21
def
file_fixture
(request):
22
return
request.param
23
24
def
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_run_inputs.test_inputs
test_inputs(file_fixture)
Definition
test_run_inputs.py:24
test_run_inputs.get_files
get_files()
Definition
test_run_inputs.py:15
test_run_inputs.coin_skipper
coin_skipper(filename)
Definition
test_run_inputs.py:11
test_run_inputs.file_fixture
file_fixture(request)
Definition
test_run_inputs.py:21
tests
test_run_inputs.py
Generated by
1.10.0