@@ -108,21 +108,39 @@ def test_repo_git_obtain_full(
108
108
109
109
@pytest .mark .parametrize (
110
110
# Postpone evaluation of options so fixture variables can interpolate
111
- "constructor,lazy_constructor_options" ,
111
+ "constructor,lazy_constructor_options,has_untracked_files " ,
112
112
[
113
113
[
114
114
GitProject ,
115
115
lambda git_remote_repo , tmp_path , ** kwargs : {
116
116
"url" : f"file://{ git_remote_repo } " ,
117
117
"dir" : tmp_path / "myrepo" ,
118
118
},
119
+ False
120
+ ],
121
+ [
122
+ GitProject ,
123
+ lambda git_remote_repo , tmp_path , ** kwargs : {
124
+ "url" : f"file://{ git_remote_repo } " ,
125
+ "dir" : tmp_path / "myrepo" ,
126
+ },
127
+ True
119
128
],
120
129
[
121
130
create_project_from_pip_url ,
122
131
lambda git_remote_repo , tmp_path , ** kwargs : {
123
132
"pip_url" : f"git+file://{ git_remote_repo } " ,
124
133
"dir" : tmp_path / "myrepo" ,
125
134
},
135
+ False
136
+ ],
137
+ [
138
+ create_project_from_pip_url ,
139
+ lambda git_remote_repo , tmp_path , ** kwargs : {
140
+ "pip_url" : f"git+file://{ git_remote_repo } " ,
141
+ "dir" : tmp_path / "myrepo" ,
142
+ },
143
+ True
126
144
],
127
145
],
128
146
)
@@ -132,9 +150,16 @@ def test_repo_update_handle_cases(
132
150
mocker : MockerFixture ,
133
151
constructor : ProjectTestFactory ,
134
152
lazy_constructor_options : ProjectTestFactoryLazyKwargs ,
153
+ has_untracked_files : bool ,
135
154
):
136
155
git_repo : GitProject = constructor (** lazy_constructor_options (** locals ()))
137
156
git_repo .obtain () # clone initial repo
157
+
158
+ if has_untracked_files :
159
+ some_file = git_repo .dir .joinpath ("some_file" )
160
+ with open (some_file , "w" ) as untracked_file :
161
+ untracked_file .write ("some content" )
162
+
138
163
mocka = mocker .spy (git_repo , "run" )
139
164
git_repo .update_repo ()
140
165
0 commit comments