Skip to content

Commit eadaa40

Browse files
MarcoGorellijreback
authored andcommitted
[CLN] remove now-unnecessary td.skip_if_no(pathlib) (#30376)
1 parent a9e2566 commit eadaa40

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

pandas/tests/io/pytables/test_store.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from distutils.version import LooseVersion
44
from io import BytesIO
55
import os
6+
from pathlib import Path
67
import re
78
from warnings import catch_warnings, simplefilter
89

@@ -4594,12 +4595,9 @@ def test_read_nokey_empty(self, setup_path):
45944595
with pytest.raises(ValueError):
45954596
read_hdf(path)
45964597

4597-
@td.skip_if_no("pathlib")
45984598
def test_read_from_pathlib_path(self, setup_path):
45994599

46004600
# GH11773
4601-
from pathlib import Path
4602-
46034601
expected = DataFrame(
46044602
np.random.rand(4, 5), index=list("abcd"), columns=list("ABCDE")
46054603
)

pandas/tests/io/sas/test_sas7bdat.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import io
22
import os
3+
from pathlib import Path
34

45
import numpy as np
56
import pytest
@@ -68,10 +69,7 @@ def test_from_iterator(self):
6869
tm.assert_frame_equal(df, df0.iloc[2:5, :])
6970
rdr.close()
7071

71-
@td.skip_if_no("pathlib")
7272
def test_path_pathlib(self):
73-
from pathlib import Path
74-
7573
for j in 0, 1:
7674
df0 = self.data[j]
7775
for k in self.test_ix[j]:

pandas/tests/io/test_common.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from io import StringIO
55
import mmap
66
import os
7+
from pathlib import Path
78

89
import pytest
910

@@ -27,14 +28,7 @@ def __fspath__(self):
2728

2829

2930
# Functions that consume a string path and return a string or path-like object
30-
path_types = [str, CustomFSPath]
31-
32-
try:
33-
from pathlib import Path
34-
35-
path_types.append(Path)
36-
except ImportError:
37-
pass
31+
path_types = [str, CustomFSPath, Path]
3832

3933
try:
4034
from py.path import local as LocalPath
@@ -73,7 +67,6 @@ def test_expand_user_normal_path(self):
7367
assert expanded_name == filename
7468
assert os.path.expanduser(filename) == expanded_name
7569

76-
@td.skip_if_no("pathlib")
7770
def test_stringify_path_pathlib(self):
7871
rel_path = icom._stringify_path(Path("."))
7972
assert rel_path == "."

0 commit comments

Comments
 (0)