@@ -38,8 +38,10 @@ def gitlab_version(gl) -> GitlabVersion:
3838
3939
4040@pytest .fixture (scope = "session" )
41- def fixture_dir (pt_gitlab_dir : Path ) -> Path :
42- return pt_gitlab_dir / "docker"
41+ def docker_assets_dir () -> Path :
42+ import gitlab .testing
43+
44+ return Path (gitlab .testing .__file__ ).parent / "docker"
4345
4446
4547@pytest .fixture (scope = "session" )
@@ -127,7 +129,7 @@ def reset_gitlab(gl: gitlab.Gitlab) -> None: # noqa C901
127129 time .sleep (2 )
128130
129131
130- def set_token (container : str , fixture_dir : Path , gitlab_url : str ) -> str :
132+ def set_token (container : str , docker_assets_dir : Path , gitlab_url : str ) -> str :
131133 logging .info ("Trying to load saved token" )
132134 gitlab_token_path = Path (".gitlab_token" )
133135 if gitlab_token_path .exists ():
@@ -141,7 +143,7 @@ def set_token(container: str, fixture_dir: Path, gitlab_url: str) -> str:
141143 return saved_token
142144
143145 logging .info ("Creating API token." )
144- set_token_rb = fixture_dir / "set_token.rb"
146+ set_token_rb = docker_assets_dir / "set_token.rb"
145147
146148 with Path (set_token_rb ).open (encoding = "utf-8" ) as f :
147149 set_token_command = f .read ().strip ()
@@ -229,7 +231,7 @@ def gitlab_token(
229231 gitlab_container_name : str ,
230232 gitlab_url : str ,
231233 docker_services ,
232- fixture_dir : Path ,
234+ docker_assets_dir : Path ,
233235) -> str :
234236 start_time = time .perf_counter ()
235237 logging .info ("Waiting for GitLab container to become ready." )
@@ -249,7 +251,9 @@ def gitlab_token(
249251 )
250252
251253 return set_token (
252- gitlab_container_name , fixture_dir = fixture_dir , gitlab_url = gitlab_url
254+ gitlab_container_name ,
255+ docker_assets_dir = docker_assets_dir ,
256+ gitlab_url = gitlab_url ,
253257 )
254258
255259
0 commit comments