5
5
6
6
7
7
@pytest .mark .parametrize (
8
- ('args' , 'expected_retval' ), (
9
- (['--style=Google' ], (0 , "" )),
10
- (['--style=Google' , '--version=16' ], (0 , "" )),
11
- (['--style=Google' , '--version=17' ], (0 , "" )),
12
- (['--style=Google' , '--version=18' ], (0 , "" )),
13
- (['--style=Google' , '--version=19' ], (0 , "" )),
14
- (['--style=Google' , '--version=20' ], (0 , "" )),
8
+ ("args" , "expected_retval" ),
9
+ (
10
+ (["--style=Google" ], (0 , "" )),
11
+ (["--style=Google" , "--version=16" ], (0 , "" )),
12
+ (["--style=Google" , "--version=17" ], (0 , "" )),
13
+ (["--style=Google" , "--version=18" ], (0 , "" )),
14
+ (["--style=Google" , "--version=19" ], (0 , "" )),
15
+ (["--style=Google" , "--version=20" ], (0 , "" )),
15
16
),
16
17
)
17
18
def test_run_clang_format_valid (args , expected_retval , tmp_path ):
@@ -24,13 +25,19 @@ def test_run_clang_format_valid(args, expected_retval, tmp_path):
24
25
25
26
26
27
@pytest .mark .parametrize (
27
- ('args' , 'expected_retval' ), (
28
- (['--style=Google' ,], 1 ),
29
- (['--style=Google' , '--version=16' ], 1 ),
30
- (['--style=Google' , '--version=17' ], 1 ),
31
- (['--style=Google' , '--version=18' ], 1 ),
32
- (['--style=Google' , '--version=19' ], 1 ),
33
- (['--style=Google' , '--version=20' ], 1 ),
28
+ ("args" , "expected_retval" ),
29
+ (
30
+ (
31
+ [
32
+ "--style=Google" ,
33
+ ],
34
+ 1 ,
35
+ ),
36
+ (["--style=Google" , "--version=16" ], 1 ),
37
+ (["--style=Google" , "--version=17" ], 1 ),
38
+ (["--style=Google" , "--version=18" ], 1 ),
39
+ (["--style=Google" , "--version=19" ], 1 ),
40
+ (["--style=Google" , "--version=20" ], 1 ),
34
41
),
35
42
)
36
43
def test_run_clang_format_invalid (args , expected_retval , tmp_path ):
@@ -42,12 +49,18 @@ def test_run_clang_format_invalid(args, expected_retval, tmp_path):
42
49
43
50
44
51
@pytest .mark .parametrize (
45
- ('args' , 'expected_retval' ), (
46
- (['--style=Google' ,], 1 ),
52
+ ("args" , "expected_retval" ),
53
+ (
54
+ (
55
+ [
56
+ "--style=Google" ,
57
+ ],
58
+ 1 ,
59
+ ),
47
60
),
48
61
)
49
62
def test_run_clang_format_dry_run (args , expected_retval , tmp_path ):
50
63
# copy test file to tmp_path to prevent modifying repo data
51
64
test_file = tmp_path / "main.c"
52
- ret , _ = run_clang_format ([' --dry-run' , str (test_file )])
65
+ ret , _ = run_clang_format ([" --dry-run" , str (test_file )])
53
66
assert ret == - 1 # Dry run should not fail
0 commit comments