File tree 1 file changed +31
-17
lines changed
1 file changed +31
-17
lines changed Original file line number Diff line number Diff line change @@ -62,41 +62,55 @@ def write_config_remote(
62
62
)
63
63
64
64
65
- @pytest .mark .parametrize (
66
- "config_tpl,remote_list" ,
67
- [
68
- [
69
- """
65
+ class ConfigVariationTest (t .NamedTuple ):
66
+ test_id : str
67
+ config_tpl : str
68
+ remote_list : list [str ]
69
+
70
+
71
+ CONFIG_VARIATION_FIXTURES = [
72
+ ConfigVariationTest (
73
+ test_id = "default" ,
74
+ config_tpl = """
70
75
{tmp_path}/study/myrepo:
71
76
{CLONE_NAME}: git+file://{dir}
72
77
""" ,
73
- ["origin" ],
74
- ],
75
- [
76
- """
78
+ remote_list = ["origin" ],
79
+ ),
80
+ ConfigVariationTest (
81
+ test_id = "two" ,
82
+ config_tpl = """
77
83
{tmp_path}/study/myrepo:
78
84
{CLONE_NAME}:
79
85
repo: git+file://{dir}
80
86
""" ,
81
- ["repo" ],
82
- ],
83
- [
84
- """
87
+ remote_list = ["repo" ],
88
+ ),
89
+ ConfigVariationTest (
90
+ test_id = "three" ,
91
+ config_tpl = """
85
92
{tmp_path}/study/myrepo:
86
93
{CLONE_NAME}:
87
94
repo: git+file://{dir}
88
95
remotes:
89
96
secondremote: git+file://{dir}
90
97
""" ,
91
- ["secondremote" ],
92
- ],
93
- ],
98
+ remote_list = ["secondremote" ],
99
+ ),
100
+ ]
101
+
102
+
103
+ @pytest .mark .parametrize (
104
+ list (ConfigVariationTest ._fields ),
105
+ CONFIG_VARIATION_FIXTURES ,
106
+ ids = [test .test_id for test in CONFIG_VARIATION_FIXTURES ],
94
107
)
95
108
def test_config_variations (
96
109
tmp_path : pathlib .Path ,
110
+ capsys : pytest .CaptureFixture [str ],
97
111
create_git_remote_repo : CreateProjectCallbackFixtureProtocol ,
112
+ test_id : str ,
98
113
config_tpl : str ,
99
- capsys : pytest .CaptureFixture [str ],
100
114
remote_list : list [str ],
101
115
) -> None :
102
116
"""Test config output with variation of config formats"""
You can’t perform that action at this time.
0 commit comments