Skip to content

Commit f83e16b

Browse files
committed
fix test setup
1 parent 9c6eeed commit f83e16b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

test/asynchronous/test_client_backpressure.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from __future__ import annotations
1515

1616
import os
17+
import pathlib
1718
import sys
1819

1920
sys.path[0:0] = [""]
@@ -45,8 +46,11 @@ async def asyncSetUp(self) -> None:
4546
)
4647

4748

48-
_TEST_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "client-backpressure")
49-
49+
# Location of JSON test specifications.
50+
if _IS_SYNC:
51+
_TEST_PATH = os.path.join(pathlib.Path(__file__).resolve().parent, "client-backpressure")
52+
else:
53+
_TEST_PATH = os.path.join(pathlib.Path(__file__).resolve().parent.parent, "client-backpressure")
5054

5155
globals().update(
5256
generate_test_classes(

test/test_client_backpressure.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from __future__ import annotations
1515

1616
import os
17+
import pathlib
1718
import sys
1819

1920
sys.path[0:0] = [""]
@@ -43,8 +44,11 @@ def setUp(self) -> None:
4344
self.client = self.rs_or_single_client(event_listeners=[self.listener], retryWrites=False)
4445

4546

46-
_TEST_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "client-backpressure")
47-
47+
# Location of JSON test specifications.
48+
if _IS_SYNC:
49+
_TEST_PATH = os.path.join(pathlib.Path(__file__).resolve().parent, "client-backpressure")
50+
else:
51+
_TEST_PATH = os.path.join(pathlib.Path(__file__).resolve().parent.parent, "client-backpressure")
4852

4953
globals().update(
5054
generate_test_classes(

0 commit comments

Comments
 (0)