@@ -165,17 +165,36 @@ def test_git_get_url_and_rev_from_pip_url():
165
165
assert rev == "eucalyptus"
166
166
167
167
168
- def test_remotes_preserves_git_ssh (repos_path , git_remote ):
168
+ @pytest .mark .parametrize (
169
+ # Postpone evaluation of options so fixture variables can interpolate
170
+ "constructor,lazy_constructor_options" ,
171
+ [
172
+ [
173
+ GitRepo ,
174
+ lambda git_remote , repo_dir , ** kwargs : {
175
+ "url" : f"file://{ git_remote } " ,
176
+ "repo_dir" : str (repo_dir ),
177
+ },
178
+ ],
179
+ [
180
+ create_repo_from_pip_url ,
181
+ lambda git_remote , repo_dir , ** kwargs : {
182
+ "pip_url" : f"git+file://{ git_remote } " ,
183
+ "repo_dir" : repo_dir ,
184
+ },
185
+ ],
186
+ ],
187
+ )
188
+ def test_remotes_preserves_git_ssh (
189
+ repos_path , git_remote , constructor , lazy_constructor_options
190
+ ):
169
191
# Regression test for #14
170
192
repo_name = "myexamplegit"
171
193
repo_dir = repos_path / repo_name
172
194
remote_name = "myremote"
173
195
remote_url = "git+ssh://git@github.com/tony/AlgoXY.git"
196
+ git_repo = constructor (** lazy_constructor_options (** locals ()))
174
197
175
- git_repo = GitRepo (
176
- url = f"file://{ git_remote } " ,
177
- repo_dir = str (repo_dir ),
178
- )
179
198
git_repo .obtain ()
180
199
git_repo .set_remote (name = remote_name , url = remote_url )
181
200
0 commit comments