19
19
import pytest
20
20
21
21
from pandas .compat import is_platform_windows
22
- import pandas .util ._test_decorators as td
23
22
24
23
import pandas as pd
25
24
import pandas ._testing as tm
@@ -41,16 +40,6 @@ def __fspath__(self):
41
40
return self .path
42
41
43
42
44
- # Functions that consume a string path and return a string or path-like object
45
- path_types = [str , CustomFSPath , Path ]
46
-
47
- try :
48
- from py .path import local as LocalPath
49
-
50
- path_types .append (LocalPath )
51
- except ImportError :
52
- pass
53
-
54
43
HERE = os .path .abspath (os .path .dirname (__file__ ))
55
44
56
45
@@ -86,13 +75,6 @@ def test_stringify_path_pathlib(self):
86
75
redundant_path = icom .stringify_path (Path ("foo//bar" ))
87
76
assert redundant_path == os .path .join ("foo" , "bar" )
88
77
89
- @td .skip_if_no ("py.path" )
90
- def test_stringify_path_localpath (self ):
91
- path = os .path .join ("foo" , "bar" )
92
- abs_path = os .path .abspath (path )
93
- lpath = LocalPath (path )
94
- assert icom .stringify_path (lpath ) == abs_path
95
-
96
78
def test_stringify_path_fspath (self ):
97
79
p = CustomFSPath ("foo/bar.csv" )
98
80
result = icom .stringify_path (p )
@@ -105,7 +87,7 @@ def test_stringify_file_and_path_like(self):
105
87
with fsspec .open (f"file://{ path } " , mode = "wb" ) as fsspec_obj :
106
88
assert fsspec_obj == icom .stringify_path (fsspec_obj )
107
89
108
- @pytest .mark .parametrize ("path_type" , path_types )
90
+ @pytest .mark .parametrize ("path_type" , [ str , CustomFSPath , Path ] )
109
91
def test_infer_compression_from_path (self , compression_format , path_type ):
110
92
extension , expected = compression_format
111
93
path = path_type ("foo/bar.csv" + extension )
@@ -114,7 +96,6 @@ def test_infer_compression_from_path(self, compression_format, path_type):
114
96
115
97
@pytest .mark .parametrize ("path_type" , [str , CustomFSPath , Path ])
116
98
def test_get_handle_with_path (self , path_type ):
117
- # ignore LocalPath: it creates strange paths: /absolute/~/sometest
118
99
with tempfile .TemporaryDirectory (dir = Path .home ()) as tmp :
119
100
filename = path_type ("~/" + Path (tmp ).name + "/sometest" )
120
101
with icom .get_handle (filename , "w" ) as handles :
0 commit comments