@@ -41,12 +41,14 @@ def pytest_collect_file(parent, path):
41
41
return RemoteRepoList .from_parent (parent , fspath = path )
42
42
43
43
44
- def make_test_func (args , skip_build = False ):
44
+ def make_test_func (args , skip_build = False , extra_run_kwargs = None ):
45
45
"""Generate a test function that runs repo2docker"""
46
46
47
47
def test ():
48
48
app = make_r2d (args )
49
49
app .initialize ()
50
+ if extra_run_kwargs :
51
+ app .extra_run_kwargs .update (extra_run_kwargs )
50
52
if skip_build :
51
53
52
54
def build_noop ():
@@ -193,10 +195,14 @@ def repo_with_submodule():
193
195
class Repo2DockerTest (pytest .Function ):
194
196
"""A pytest.Item for running repo2docker"""
195
197
196
- def __init__ (self , name , parent , args = None , skip_build = False ):
198
+ def __init__ (
199
+ self , name , parent , args = None , skip_build = False , extra_run_kwargs = None
200
+ ):
197
201
self .args = args
198
202
self .save_cwd = os .getcwd ()
199
- f = parent .obj = make_test_func (args , skip_build = skip_build )
203
+ f = parent .obj = make_test_func (
204
+ args , skip_build = skip_build , extra_run_kwargs = extra_run_kwargs
205
+ )
200
206
super ().__init__ (name , parent , callobj = f )
201
207
202
208
def reportinfo (self ):
@@ -254,6 +260,7 @@ def collect(self):
254
260
name = "check-tmp" ,
255
261
args = check_tmp_args ,
256
262
skip_build = True ,
263
+ extra_run_kwargs = {"user" : "root" },
257
264
)
258
265
259
266
0 commit comments