Skip to content

Commit 8717536

Browse files
committed
CI: Fix path computation for Windows again
1 parent 39fbad7 commit 8717536

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/crate/client/tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import json
2525
import os
2626
import socket
27+
import pathlib
28+
import sys
2729
import unittest
2830
import doctest
2931
from pprint import pprint
@@ -166,7 +168,11 @@ def setUpWithCrateLayer(test):
166168
cursor.execute(stmt)
167169
assert cursor.fetchall()[0][0] == 1
168170

171+
# Compute path to file for data loading.
169172
data_path = docs_path('testing/testdata/data/test_a.json')
173+
if sys.platform == 'win32':
174+
data_path = pathlib.PureWindowsPath(data_path).as_uri()
175+
170176
# load testing data into crate
171177
cursor.execute("copy locations from ?", (data_path,))
172178
# refresh location table so imported data is visible immediately

src/crate/testing/tests.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
# software solely pursuant to the terms of the relevant commercial agreement.
2222

2323
import os
24-
import pathlib
25-
import sys
2624
import unittest
2725
import doctest
2826
import tempfile
@@ -35,8 +33,6 @@ def docs_path(*parts):
3533
os.path.dirname(os.path.dirname(__file__)), *parts
3634
)
3735
)
38-
if sys.platform == 'win32':
39-
path = pathlib.PureWindowsPath(path).as_uri()
4036
return path
4137

4238

0 commit comments

Comments
 (0)