File tree 6 files changed +9
-19
lines changed
6 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ def test_path_pathlib(self):
83
83
df = pd .read_sas (fname , encoding = 'utf-8' )
84
84
tm .assert_frame_equal (df , df0 )
85
85
86
+ @td .skip_if_no ('py.path' )
86
87
def test_path_localpath (self ):
87
- tm ._skip_if_no_localpath ()
88
88
from py .path import local as LocalPath
89
89
for j in 0 , 1 :
90
90
df0 = self .data [j ]
Original file line number Diff line number Diff line change @@ -75,9 +75,8 @@ def test_stringify_path_pathlib(self):
75
75
redundant_path = common ._stringify_path (Path ('foo//bar' ))
76
76
assert redundant_path == os .path .join ('foo' , 'bar' )
77
77
78
+ @td .skip_if_no ('py.path' )
78
79
def test_stringify_path_localpath (self ):
79
- tm ._skip_if_no_localpath ()
80
-
81
80
path = os .path .join ('foo' , 'bar' )
82
81
abs_path = os .path .abspath (path )
83
82
lpath = LocalPath (path )
Original file line number Diff line number Diff line change @@ -665,11 +665,10 @@ def test_read_from_pathlib_path(self):
665
665
666
666
tm .assert_frame_equal (expected , actual )
667
667
668
+ @td .skip_if_no ('py.path' )
668
669
def test_read_from_py_localpath (self ):
669
670
670
671
# GH12655
671
- tm ._skip_if_no_localpath ()
672
-
673
672
from py .path import local as LocalPath
674
673
675
674
str_path = os .path .join (self .dirpath , 'test1' + self .ext )
Original file line number Diff line number Diff line change @@ -5119,11 +5119,10 @@ def test_read_nokey_empty(self):
5119
5119
store .close ()
5120
5120
pytest .raises (ValueError , read_hdf , path )
5121
5121
5122
+ @td .skip_if_no ('pathlib' )
5122
5123
def test_read_from_pathlib_path (self ):
5123
5124
5124
5125
# GH11773
5125
- tm ._skip_if_no_pathlib ()
5126
-
5127
5126
from pathlib import Path
5128
5127
5129
5128
expected = DataFrame (np .random .rand (4 , 5 ),
@@ -5137,11 +5136,10 @@ def test_read_from_pathlib_path(self):
5137
5136
5138
5137
tm .assert_frame_equal (expected , actual )
5139
5138
5139
+ @td .skip_if_no ('py.path' )
5140
5140
def test_read_from_py_localpath (self ):
5141
5141
5142
5142
# GH11773
5143
- tm ._skip_if_no_localpath ()
5144
-
5145
5143
from py .path import local as LocalPath
5146
5144
5147
5145
expected = DataFrame (np .random .rand (4 , 5 ),
Original file line number Diff line number Diff line change @@ -96,8 +96,10 @@ def _skip_if_not_us_locale():
96
96
97
97
def skip_if_no (package , min_version = None ):
98
98
def decorated_func (func ):
99
- return pytest .mark .skipif (not safe_import (package , min_version = min_version ),
100
- reason = "Could not import '{}'" .format (package ))(func )
99
+ return pytest .mark .skipif (
100
+ not safe_import (package , min_version = min_version ),
101
+ reason = "Could not import '{}'" .format (package )
102
+ )(func )
101
103
return decorated_func
102
104
103
105
Original file line number Diff line number Diff line change @@ -359,14 +359,6 @@ def _skip_if_no_xarray():
359
359
pytest .skip ("xarray version is too low: {version}" .format (version = v ))
360
360
361
361
362
- def _skip_if_no_localpath ():
363
- try :
364
- from py .path import local as LocalPath # noqa
365
- except ImportError :
366
- import pytest
367
- pytest .skip ("py.path not installed" )
368
-
369
-
370
362
def skip_if_no_ne (engine = 'numexpr' ):
371
363
from pandas .core .computation .expressions import (
372
364
_USE_NUMEXPR ,
You can’t perform that action at this time.
0 commit comments