Skip to content

Commit 8923a3f

Browse files
committed
CI: Fix path computation for Windows again
1 parent 6b8b5d4 commit 8923a3f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/crate/client/tests.py

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
import json
2525
import os
26+
import pathlib
27+
import sys
2628
import unittest
2729
import doctest
2830
from pprint import pprint
@@ -143,7 +145,11 @@ def setUpWithCrateLayer(test):
143145
cursor.execute(stmt)
144146
assert cursor.fetchall()[0][0] == 1
145147

148+
# Compute path to file for data loading.
146149
data_path = docs_path('testing/testdata/data/test_a.json')
150+
if sys.platform == 'win32':
151+
data_path = pathlib.PureWindowsPath(data_path).as_uri()
152+
147153
# load testing data into crate
148154
cursor.execute("copy locations from ?", (data_path,))
149155
# refresh location table so imported data is visible immediately

src/crate/testing/tests.py

-4
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)