55
66
77@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 , "" )),
1516 ),
1617)
1718def 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):
2425
2526
2627@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 ),
3441 ),
3542)
3643def 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):
4249
4350
4451@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+ ),
4760 ),
4861)
4962def test_run_clang_format_dry_run (args , expected_retval , tmp_path ):
5063 # copy test file to tmp_path to prevent modifying repo data
5164 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 )])
5366 assert ret == - 1 # Dry run should not fail
0 commit comments