Skip to content

Commit c87fd7a

Browse files
committed
fixup: migrating to pathlib
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
1 parent 18dd5cd commit c87fd7a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

providers/openfeature-provider-flagd/tests/e2e/flagd_container.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import os
21
import time
2+
from pathlib import Path
33

44
import grpc
55
from grpc_health.v1 import health_pb2, health_pb2_grpc
@@ -16,10 +16,8 @@ def __init__(
1616
port: int = 8013,
1717
**kwargs,
1818
) -> None:
19-
my_path = os.path.abspath(os.path.dirname(__file__))
20-
path = os.path.join(my_path, "../../openfeature/test-harness/version.txt")
21-
with open(path) as file:
22-
data = file.read().rstrip()
19+
path = Path(__file__).parents[2] / "openfeature/test-harness/version.txt"
20+
data = path.read_text().rstrip()
2321
super().__init__(f"{image}:v{data}", **kwargs)
2422
self.port = port
2523
self.with_exposed_ports(self.port, HEALTH_CHECK)

0 commit comments

Comments
 (0)