Skip to content

Commit f7330d9

Browse files
committed
FIX: Clean up expected types, undefined name
1 parent 0f1aefb commit f7330d9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

fmriprep/reports/tests/test_reports.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Test with and without sessions' aggregation
1515
@pytest.mark.parametrize(
16-
'aggr_ses_reports, expected_files',
16+
('aggr_ses_reports', 'expected_files'),
1717
[
1818
(
1919
3,
@@ -29,15 +29,15 @@
2929
],
3030
)
3131
# Test with and without crash file
32-
@pytest.mark.parametrize('error', (True, False))
32+
@pytest.mark.parametrize('error', [True, False])
3333
# Test with and without boilerplate
34-
@pytest.mark.parametrize('boilerplate', (True, False))
34+
@pytest.mark.parametrize('boilerplate', [True, False])
3535
# Test ses- prefix stripping
3636
@pytest.mark.parametrize(
37-
'session_list', (['001', '003', '004', '005'], ['ses-001', 'ses-003', 'ses-004', 'ses-005'])
37+
'session_list', [['001', '003', '004', '005'], ['ses-001', 'ses-003', 'ses-004', 'ses-005']]
3838
)
3939
# Test sub- prefix stripping
40-
@pytest.mark.parametrize('subject_label', ('001', 'sub-001'))
40+
@pytest.mark.parametrize('subject_label', ['001', 'sub-001'])
4141
@pytest.mark.skipif(
4242
not Path.exists(data_dir / 'work'),
4343
reason='Package installed - large test data directory excluded from wheel',
@@ -93,7 +93,7 @@ def mock_session_list(*args, **kwargs):
9393
assert file_path.is_file(), f'Expected file {expected_file} is missing'
9494

9595
# Check if there are no unexpected HTML files
96-
unexpected_files = set(file.name for file in tmp_path.glob('*.html')) - set(expected_files)
96+
unexpected_files = {file.name for file in tmp_path.glob('*.html')} - set(expected_files)
9797
assert not unexpected_files, f'Unexpected HTML files found: {unexpected_files}'
9898

9999
if not (boilerplate or error):
@@ -103,9 +103,9 @@ def mock_session_list(*args, **kwargs):
103103
if boilerplate:
104104
assert (
105105
'The boilerplate text was automatically generated' in html_content
106-
), f'The file {file} did not contain the reported error.'
106+
), f'The file {expected_files[0]} did not contain the reported error.'
107107

108108
if error:
109109
assert (
110110
'One or more execution steps failed' in html_content
111-
), f'The file {file} did not contain the reported error.'
111+
), f'The file {expected_files[0]} did not contain the reported error.'

0 commit comments

Comments
 (0)