Skip to content

Commit f0b6d58

Browse files
STY: Apply ruff/flake8-pytest-style rule PT006
PT006 Wrong type passed to first argument of `@pytest.mark.parametrize`; expected `tuple`
1 parent 00e19f4 commit f0b6d58

File tree

14 files changed

+28
-24
lines changed

14 files changed

+28
-24
lines changed

nipype/algorithms/tests/test_CompCor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def close_up_to_column_sign(a, b, rtol=1e-05, atol=1e-08, equal_nan=False):
2828

2929

3030
@pytest.mark.parametrize(
31-
"a, b, close",
31+
("a", "b", "close"),
3232
[
3333
([[0.1, 0.2], [0.3, 0.4]], [[-0.1, 0.2], [-0.3, 0.4]], True),
3434
([[0.1, 0.2], [0.3, 0.4]], [[-0.1, 0.2], [0.3, -0.4]], False),

nipype/algorithms/tests/test_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_ActivationCount(tmpdir):
2222

2323

2424
@pytest.mark.parametrize(
25-
"threshold, above_thresh",
25+
("threshold", "above_thresh"),
2626
[
2727
(1, 15.865), # above one standard deviation (one side)
2828
(2, 2.275), # above two standard deviations (one side)

nipype/interfaces/ants/tests/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
# fmt: on
2121

2222

23-
@pytest.mark.parametrize("raw_info, version", ANTS_VERSIONS)
23+
@pytest.mark.parametrize(("raw_info", "version"), ANTS_VERSIONS)
2424
def test_version_parser(raw_info, version):
2525
assert Info.parse_version(raw_info) == version

nipype/interfaces/base/tests/test_resource_monitor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ class UseResources(CommandLine):
5555

5656
@pytest.mark.skip(reason="inconsistent readings")
5757
@pytest.mark.skipif(os.getenv("CI_SKIP_TEST", False), reason="disabled in CI tests")
58-
@pytest.mark.parametrize("mem_gb,n_procs", [(0.5, 3), (2.2, 8), (0.8, 4), (1.5, 1)])
58+
@pytest.mark.parametrize(
59+
("mem_gb", "n_procs"), [(0.5, 3), (2.2, 8), (0.8, 4), (1.5, 1)]
60+
)
5961
def test_cmdline_profiling(tmpdir, mem_gb, n_procs, use_resource_monitor):
6062
"""
6163
Test runtime profiler correctly records workflow RAM/CPUs consumption
@@ -80,7 +82,9 @@ def test_cmdline_profiling(tmpdir, mem_gb, n_procs, use_resource_monitor):
8082
@pytest.mark.skipif(
8183
True, reason="test disabled temporarily, until function profiling works"
8284
)
83-
@pytest.mark.parametrize("mem_gb,n_procs", [(0.5, 3), (2.2, 8), (0.8, 4), (1.5, 1)])
85+
@pytest.mark.parametrize(
86+
("mem_gb", "n_procs"), [(0.5, 3), (2.2, 8), (0.8, 4), (1.5, 1)]
87+
)
8488
def test_function_profiling(tmpdir, mem_gb, n_procs, use_resource_monitor):
8589
"""
8690
Test runtime profiler correctly records workflow RAM/CPUs consumption

nipype/interfaces/fsl/tests/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_FSLCommand2():
6060

6161
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
6262
@pytest.mark.parametrize(
63-
"args, desired_name",
63+
("args", "desired_name"),
6464
[
6565
({}, {"file": "foo.nii.gz"}), # just the filename
6666
# filename with suffix

nipype/interfaces/fsl/tests/test_preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def setup_fugue(tmpdir):
588588

589589
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
590590
@pytest.mark.parametrize(
591-
"attr, out_file",
591+
("attr", "out_file"),
592592
[
593593
(
594594
{

nipype/interfaces/tests/test_dcm2nii.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
@pytest.mark.parametrize(
8-
"fname, extension, search_crop",
8+
("fname", "extension", "search_crop"),
99
[
1010
("output_1", ".txt", False),
1111
("output_w_[]_meta_1", ".json", False),

nipype/interfaces/tests/test_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_s3datagrabber():
104104

105105

106106
@pytest.mark.parametrize(
107-
"SF_args, inputs_att, expected",
107+
("SF_args", "inputs_att", "expected"),
108108
[
109109
(
110110
{"templates": templates1},

nipype/interfaces/utility/tests/test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_rename(tmpdir):
3737

3838

3939
@pytest.mark.parametrize(
40-
"args, expected", [({}, ([0], [1, 2, 3])), ({"squeeze": True}, (0, [1, 2, 3]))]
40+
("args", "expected"), [({}, ([0], [1, 2, 3])), ({"squeeze": True}, (0, [1, 2, 3]))]
4141
)
4242
def test_split(tmpdir, args, expected):
4343
tmpdir.chdir()
@@ -52,7 +52,7 @@ def test_split(tmpdir, args, expected):
5252

5353

5454
@pytest.mark.parametrize(
55-
"args, kwargs, in_lists, expected",
55+
("args", "kwargs", "in_lists", "expected"),
5656
[
5757
([3], {}, [0, [1, 2], [3, 4, 5]], [0, 1, 2, 3, 4, 5]),
5858
([0], {}, None, None),

nipype/pipeline/engine/tests/test_engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# XXX - SG I'll create a graphical version of these tests and actually
1717
# ensure that all connections are tested later
1818
@pytest.mark.parametrize(
19-
"iterables, expected",
19+
("iterables", "expected"),
2020
[
2121
({"1": None}, (1, 0)), # test1
2222
({"1": dict(input1=lambda: [1, 2], input2=lambda: [1, 2])}, (4, 0)), # test2
@@ -34,7 +34,7 @@ def test_1mod(iterables, expected):
3434

3535

3636
@pytest.mark.parametrize(
37-
"iterables, expected",
37+
("iterables", "expected"),
3838
[
3939
({"1": {}, "2": dict(input1=lambda: [1, 2])}, (3, 2)), # test3
4040
({"1": dict(input1=lambda: [1, 2]), "2": {}}, (4, 2)), # test4
@@ -58,7 +58,7 @@ def test_2mods(iterables, expected):
5858

5959

6060
@pytest.mark.parametrize(
61-
"iterables, expected, connect",
61+
("iterables", "expected", "connect"),
6262
[
6363
(
6464
{"1": {}, "2": dict(input1=lambda: [1, 2]), "3": {}},

0 commit comments

Comments
 (0)