Skip to content

Commit 1d48e6c

Browse files
fixed stuff
1 parent c32bfbd commit 1d48e6c

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

conftest.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,11 @@ def data_ivim_fit_saved(datafile, algorithmFile):
215215
kwargs = algorithm_dict.get("options", {})
216216
tolerances = algorithm_dict.get("tolerances", {})
217217
skiptime=False
218-
if first == True:
219-
if algorithm_dict.get("fail_first_time", {}) == True:
218+
if first:
219+
if algorithm_dict.get("fail_first_time", False):
220220
skiptime = True
221221
first = False
222-
if algorithm_dict.get("requires_matlab", False) == True:
223-
requires_matlab = True
224-
else:
225-
requires_matlab = False
222+
requires_matlab = algorithm_dict.get("requires_matlab", False)
226223
yield name, bvals, data, algorithm, xfail, kwargs, tolerances, skiptime, requires_matlab
227224

228225
def algorithmlist(algorithmFile):
@@ -235,10 +232,7 @@ def algorithmlist(algorithmFile):
235232
algorithms = algorithm_information["algorithms"]
236233
for algorithm in algorithms:
237234
algorithm_dict = algorithm_information.get(algorithm, {})
238-
if algorithm_dict.get("requires_matlab", False) == True:
239-
requires_matlab = True
240-
else:
241-
requires_matlab = False
235+
requires_matlab = algorithm_dict.get("requires_matlab", False)
242236
yield algorithm, requires_matlab
243237

244238
def bound_input(datafile,algorithmFile):
@@ -261,8 +255,5 @@ def bound_input(datafile,algorithmFile):
261255
"strict": algorithm_dict.get("xfail_names", {}).get(name, True)}
262256
kwargs = algorithm_dict.get("options", {})
263257
tolerances = algorithm_dict.get("tolerances", {})
264-
if algorithm_dict.get("requires_matlab", False) == True:
265-
requires_matlab = True
266-
else:
267-
requires_matlab = False
258+
requires_matlab = algorithm_dict.get("requires_matlab", False)
268259
yield name, bvals, data, algorithm, xfail, kwargs, tolerances, requires_matlab

tests/IVIMmodels/unit_tests/test_ivim_fit.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ def test_ivim_fit_saved(data_ivim_fit_saved, eng, request, record_property):
3636
if requires_matlab:
3737
max_time = 2
3838
if eng is None:
39-
print('test is here')
4039
pytest.skip(reason="Running without matlab; if Matlab is available please run pytest --withmatlab")
4140
else:
42-
print('test is not here')
4341
kwargs = {**kwargs, 'eng': eng}
4442
if xfail["xfail"]:
4543
mark = pytest.mark.xfail(reason="xfail", strict=xfail["strict"])

tests/IVIMmodels/unit_tests/test_ivim_synthetic.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
def test_generated(algorithmlist, skip_list, ivim_data, SNR, rtol, atol, fit_count, rician_noise, save_file, save_duration_file, use_prior):
1818
# assert save_file == "test"
1919
ivim_algorithm, requires_matlab = algorithmlist
20-
if requires_matlab:
21-
if eng is None:
22-
pytest.skip(reason="Running without matlab; if Matlab is available please run pytest --withmatlab")
20+
if requires_matlab and eng is None:
21+
pytest.skip(reason="Running without matlab; if Matlab is available please run pytest --withmatlab")
2322
rng = np.random.RandomState(42)
2423
# random.seed(42)
2524
S0 = 1

0 commit comments

Comments
 (0)