8
8
9
9
@pytest .fixture (scope = "module" )
10
10
def docker_compose_file (pytestconfig ):
11
- return os .path .join (str (pytestconfig .rootdir ), "docker- compose.yml" )
11
+ return os .path .join (str (pytestconfig .rootdir ), "compose.yml" )
12
12
13
13
14
14
def wait_container_ready (driver ):
@@ -32,9 +32,14 @@ def wait_container_ready(driver):
32
32
33
33
@pytest .fixture (scope = "module" )
34
34
def endpoint (pytestconfig , module_scoped_container_getter ):
35
- with ydb .Driver (endpoint = "localhost:2136" , database = "/local" ) as driver :
35
+ e = "grpc://localhost:2136"
36
+ if os .environ .get ('REMOTE_CONTAINERS' ) is not None :
37
+ e = "grpc://py-sdk-ydb:2136"
38
+
39
+ with ydb .Driver (endpoint = e , database = "/local" ) as driver :
36
40
wait_container_ready (driver )
37
- yield "localhost:2136"
41
+
42
+ yield e
38
43
39
44
40
45
@pytest .fixture (scope = "session" )
@@ -47,13 +52,19 @@ def secure_endpoint(pytestconfig, session_scoped_container_getter):
47
52
48
53
assert os .path .exists (ca_path )
49
54
os .environ ["YDB_SSL_ROOT_CERTIFICATES_FILE" ] = ca_path
55
+
56
+ e = "grpcs://localhost:2135"
57
+ if os .environ .get ('REMOTE_CONTAINERS' ) is not None :
58
+ e = "grpcs://py-sdk-ydb:2135"
59
+
50
60
with ydb .Driver (
51
- endpoint = "grpcs://localhost:2135" ,
61
+ endpoint = e ,
52
62
database = "/local" ,
53
63
root_certificates = ydb .load_ydb_root_certificate (),
54
64
) as driver :
55
65
wait_container_ready (driver )
56
- yield "localhost:2135"
66
+
67
+ yield e
57
68
58
69
59
70
@pytest .fixture (scope = "module" )
0 commit comments