@@ -50,27 +50,6 @@ def reset_gitlab(gl: gitlab.Gitlab) -> None:
5050 helpers .safe_delete (user , hard_delete = True )
5151
5252
53- def set_token (container , fixture_dir ):
54- logging .info ("Creating API token." )
55- set_token_rb = fixture_dir / "set_token.rb"
56-
57- with open (set_token_rb , "r" , encoding = "utf-8" ) as f :
58- set_token_command = f .read ().strip ()
59-
60- rails_command = [
61- "docker" ,
62- "exec" ,
63- container ,
64- "gitlab-rails" ,
65- "runner" ,
66- set_token_command ,
67- ]
68- output = check_output (rails_command ).decode ().strip ()
69- logging .info ("Finished creating API token." )
70-
71- return output
72-
73-
7453def pytest_report_collectionfinish (config , startdir , items ):
7554 return [
7655 "" ,
@@ -157,7 +136,7 @@ def _wait(timeout=30, step=0.5):
157136
158137
159138@pytest .fixture (scope = "session" )
160- def gitlab_config (check_is_alive , docker_ip , docker_services , temp_dir , fixture_dir ):
139+ def gitlab_config (check_is_alive , docker_ip , docker_services , temp_dir ):
161140 config_file = temp_dir / "python-gitlab.cfg"
162141 port = docker_services .port_for ("gitlab" , 80 )
163142
@@ -174,15 +153,13 @@ def gitlab_config(check_is_alive, docker_ip, docker_services, temp_dir, fixture_
174153 f"GitLab container is now ready after { minutes } minute(s), { seconds } seconds"
175154 )
176155
177- token = set_token ("gitlab-test" , fixture_dir = fixture_dir )
178-
179156 config = f"""[global]
180157default = local
181158timeout = 60
182159
183160[local]
184161url = http://{ docker_ip } :{ port }
185- private_token = { token }
162+ private_token = python-gitlab- token
186163api_version = 4"""
187164
188165 with open (config_file , "w" , encoding = "utf-8" ) as f :
0 commit comments