9
9
import gitlab
10
10
11
11
12
+ @pytest .fixture (scope = "session" )
13
+ def fixture_dir (test_dir ):
14
+ return test_dir / "functional" / "fixtures"
15
+
16
+
12
17
def reset_gitlab (gl ):
13
18
# previously tools/reset_gitlab.py
14
19
for project in gl .projects .list ():
@@ -26,8 +31,8 @@ def reset_gitlab(gl):
26
31
user .delete (hard_delete = True )
27
32
28
33
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"
31
36
32
37
with open (set_token_rb , "r" ) as f :
33
38
set_token_command = f .read ().strip ()
@@ -68,13 +73,8 @@ def temp_dir():
68
73
69
74
70
75
@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"
78
78
79
79
80
80
@pytest .fixture (scope = "session" )
@@ -129,15 +129,15 @@ def _wait(timeout=30, step=0.5):
129
129
130
130
131
131
@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 ):
133
133
config_file = temp_dir / "python-gitlab.cfg"
134
134
port = docker_services .port_for ("gitlab" , 80 )
135
135
136
136
docker_services .wait_until_responsive (
137
137
timeout = 200 , pause = 5 , check = lambda : check_is_alive ("gitlab-test" )
138
138
)
139
139
140
- token = set_token ("gitlab-test" , rootdir = test_dir )
140
+ token = set_token ("gitlab-test" , fixture_dir = fixture_dir )
141
141
142
142
config = f"""[global]
143
143
default = local
0 commit comments