File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 2424import json
2525import os
2626import socket
27+ import pathlib
28+ import sys
2729import unittest
2830import doctest
2931from 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
Original file line number Diff line number Diff line change 2121# software solely pursuant to the terms of the relevant commercial agreement.
2222
2323import os
24- import pathlib
25- import sys
2624import unittest
2725import doctest
2826import 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
You can’t perform that action at this time.
0 commit comments