99import gitlab
1010
1111
12+ @pytest .fixture (scope = "session" )
13+ def fixture_dir (test_dir ):
14+ return test_dir / "functional" / "fixtures"
15+
16+
1217def reset_gitlab (gl ):
1318# previously tools/reset_gitlab.py
1419for project in gl .projects .list ():
@@ -26,8 +31,8 @@ def reset_gitlab(gl):
2631user .delete (hard_delete = True )
2732
2833
29- def set_token (container ,rootdir ):
30- set_token_rb = rootdir / "fixtures" / "set_token.rb"
34+ def set_token (container ,fixture_dir ):
35+ set_token_rb = fixture_dir / "set_token.rb"
3136
3237with open (set_token_rb ,"r" )as f :
3338set_token_command = f .read ().strip ()
@@ -68,13 +73,8 @@ def temp_dir():
6873
6974
7075@pytest .fixture (scope = "session" )
71- def test_dir (pytestconfig ):
72- return pytestconfig .rootdir / "tests" / "functional"
73-
74-
75- @pytest .fixture (scope = "session" )
76- def docker_compose_file (test_dir ):
77- return test_dir / "fixtures" / "docker-compose.yml"
76+ def docker_compose_file (fixture_dir ):
77+ return fixture_dir / "docker-compose.yml"
7878
7979
8080@pytest .fixture (scope = "session" )
@@ -129,15 +129,15 @@ def _wait(timeout=30, step=0.5):
129129
130130
131131@pytest .fixture (scope = "session" )
132- def gitlab_config (check_is_alive ,docker_ip ,docker_services ,temp_dir ,test_dir ):
132+ def gitlab_config (check_is_alive ,docker_ip ,docker_services ,temp_dir ,fixture_dir ):
133133config_file = temp_dir / "python-gitlab.cfg"
134134port = docker_services .port_for ("gitlab" ,80 )
135135
136136docker_services .wait_until_responsive (
137137timeout = 200 ,pause = 5 ,check = lambda :check_is_alive ("gitlab-test" )
138138 )
139139
140- token = set_token ("gitlab-test" ,rootdir = test_dir )
140+ token = set_token ("gitlab-test" ,fixture_dir = fixture_dir )
141141
142142config = f"""[global]
143143default = local