Skip to content

Commit b021ede

Browse files
committed
fix test_path
1 parent 0423d60 commit b021ede

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

test/asynchronous/test_csot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from __future__ import annotations
1717

1818
import os
19+
import pathlib
1920
import sys
2021

2122
sys.path[0:0] = [""]
@@ -30,7 +31,10 @@
3031
_IS_SYNC = False
3132

3233
# Location of JSON test specifications.
33-
TEST_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "csot")
34+
if _IS_SYNC:
35+
TEST_PATH = os.path.join(pathlib.Path(__file__).resolve().parent, "csot")
36+
else:
37+
TEST_PATH = os.path.join(pathlib.Path(__file__).resolve().parent.parent, "csot")
3438

3539
# Generate unified tests.
3640
globals().update(generate_test_classes(TEST_PATH, module=__name__))

test/test_csot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from __future__ import annotations
1717

1818
import os
19+
import pathlib
1920
import sys
2021

2122
sys.path[0:0] = [""]
@@ -30,7 +31,10 @@
3031
_IS_SYNC = True
3132

3233
# Location of JSON test specifications.
33-
TEST_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "csot")
34+
if _IS_SYNC:
35+
TEST_PATH = os.path.join(pathlib.Path(__file__).resolve().parent, "csot")
36+
else:
37+
TEST_PATH = os.path.join(pathlib.Path(__file__).resolve().parent.parent, "csot")
3438

3539
# Generate unified tests.
3640
globals().update(generate_test_classes(TEST_PATH, module=__name__))

0 commit comments

Comments
 (0)