Skip to content

[CLN] remove now-unnecessary td.skip_if_no(pathlib) #30376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pandas/tests/io/pytables/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from distutils.version import LooseVersion
from io import BytesIO
import os
from pathlib import Path
import re
from warnings import catch_warnings, simplefilter

Expand Down Expand Up @@ -4594,12 +4595,9 @@ def test_read_nokey_empty(self, setup_path):
with pytest.raises(ValueError):
read_hdf(path)

@td.skip_if_no("pathlib")
def test_read_from_pathlib_path(self, setup_path):

# GH11773
from pathlib import Path

expected = DataFrame(
np.random.rand(4, 5), index=list("abcd"), columns=list("ABCDE")
)
Expand Down
4 changes: 1 addition & 3 deletions pandas/tests/io/sas/test_sas7bdat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io
import os
from pathlib import Path

import numpy as np
import pytest
Expand Down Expand Up @@ -68,10 +69,7 @@ def test_from_iterator(self):
tm.assert_frame_equal(df, df0.iloc[2:5, :])
rdr.close()

@td.skip_if_no("pathlib")
def test_path_pathlib(self):
from pathlib import Path

for j in 0, 1:
df0 = self.data[j]
for k in self.test_ix[j]:
Expand Down
11 changes: 2 additions & 9 deletions pandas/tests/io/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from io import StringIO
import mmap
import os
from pathlib import Path

import pytest

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


# Functions that consume a string path and return a string or path-like object
path_types = [str, CustomFSPath]

try:
from pathlib import Path

path_types.append(Path)
except ImportError:
pass
path_types = [str, CustomFSPath, Path]

try:
from py.path import local as LocalPath
Expand Down Expand Up @@ -73,7 +67,6 @@ def test_expand_user_normal_path(self):
assert expanded_name == filename
assert os.path.expanduser(filename) == expanded_name

@td.skip_if_no("pathlib")
def test_stringify_path_pathlib(self):
rel_path = icom._stringify_path(Path("."))
assert rel_path == "."
Expand Down