File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,32 @@ def test_creates_config_dir_not_exists(tmp_path: pathlib.Path) -> None:
3131 assert tmp_path .exists ()
3232
3333
34+ class HelpTestFixture (t .NamedTuple ):
35+ """Test fixture for help command tests."""
36+
37+ test_id : str
38+ cli_args : list [str ]
39+
40+
41+ HELP_TEST_FIXTURES : list [HelpTestFixture ] = [
42+ HelpTestFixture (
43+ test_id = "help_long_flag" ,
44+ cli_args = ["--help" ],
45+ ),
46+ HelpTestFixture (
47+ test_id = "help_short_flag" ,
48+ cli_args = ["-h" ],
49+ ),
50+ ]
51+
52+
3453@pytest .mark .parametrize (
35- "cli_args" ,
36- [
37- (["--help" ]),
38- (["-h" ]),
39- ],
54+ list (HelpTestFixture ._fields ),
55+ HELP_TEST_FIXTURES ,
56+ ids = [test .test_id for test in HELP_TEST_FIXTURES ],
4057)
4158def test_help (
59+ test_id : str ,
4260 cli_args : list [str ],
4361 tmp_path : pathlib .Path ,
4462 monkeypatch : pytest .MonkeyPatch ,
You can’t perform that action at this time.
0 commit comments