Skip to content

Commit 653f73a

Browse files
fix single_cpu tests
1 parent 1563ff9 commit 653f73a

17 files changed

+81
-21
lines changed

pandas/tests/apply/test_numba.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import numpy as np
22
import pytest
33

4+
from pandas._config import using_string_dtype
5+
46
import pandas.util._test_decorators as td
57

68
from pandas import (
@@ -17,6 +19,7 @@ def apply_axis(request):
1719
return request.param
1820

1921

22+
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
2023
def test_numba_vs_python_noop(float_frame, apply_axis):
2124
func = lambda x: x
2225
result = float_frame.apply(func, engine="numba", axis=apply_axis)
@@ -40,6 +43,7 @@ def test_numba_vs_python_string_index():
4043
)
4144

4245

46+
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
4347
def test_numba_vs_python_indexing():
4448
frame = DataFrame(
4549
{"a": [1, 2, 3], "b": [4, 5, 6], "c": [7.0, 8.0, 9.0]},

pandas/tests/io/json/test_pandas.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ def test_round_trip_exception(self, datapath):
11191119
res = res.fillna(np.nan)
11201120
tm.assert_frame_equal(res, df)
11211121

1122-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
1122+
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False)
11231123
@pytest.mark.network
11241124
@pytest.mark.single_cpu
11251125
@pytest.mark.parametrize(
@@ -1422,7 +1422,6 @@ def test_read_inline_jsonl(self):
14221422
expected = DataFrame([[1, 2], [1, 2]], columns=["a", "b"])
14231423
tm.assert_frame_equal(result, expected)
14241424

1425-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
14261425
@pytest.mark.single_cpu
14271426
@td.skip_if_not_us_locale
14281427
def test_read_s3_jsonl(self, s3_public_bucket_with_data, s3so):
@@ -2022,7 +2021,6 @@ def test_json_multiindex(self):
20222021
result = series.to_json(orient="index")
20232022
assert result == expected
20242023

2025-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
20262024
@pytest.mark.single_cpu
20272025
def test_to_s3(self, s3_public_bucket, s3so):
20282026
# GH 28375

pandas/tests/io/pytables/test_append.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import numpy as np
66
import pytest
77

8+
from pandas._config import using_string_dtype
9+
810
from pandas._libs.tslibs import Timestamp
911
from pandas.compat import PY312
1012

@@ -23,7 +25,10 @@
2325
ensure_clean_store,
2426
)
2527

26-
pytestmark = pytest.mark.single_cpu
28+
pytestmark = [
29+
pytest.mark.single_cpu,
30+
pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False),
31+
]
2732

2833
tables = pytest.importorskip("tables")
2934

pandas/tests/io/pytables/test_categorical.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import numpy as np
22
import pytest
33

4+
from pandas._config import using_string_dtype
5+
46
from pandas import (
57
Categorical,
68
DataFrame,
@@ -14,7 +16,10 @@
1416
ensure_clean_store,
1517
)
1618

17-
pytestmark = pytest.mark.single_cpu
19+
pytestmark = [
20+
pytest.mark.single_cpu,
21+
pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False),
22+
]
1823

1924

2025
def test_categorical(setup_path):

pandas/tests/io/pytables/test_complex.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
from pandas.io.pytables import read_hdf
1515

16+
pytestmark = pytest.mark.xfail(
17+
using_string_dtype(), reason="TODO(infer_string)", strict=False
18+
)
19+
1620

1721
def test_complex_fixed(tmp_path, setup_path):
1822
df = DataFrame(
@@ -61,7 +65,6 @@ def test_complex_table(tmp_path, setup_path):
6165
tm.assert_frame_equal(df, reread)
6266

6367

64-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
6568
def test_complex_mixed_fixed(tmp_path, setup_path):
6669
complex64 = np.array(
6770
[1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex64
@@ -85,7 +88,6 @@ def test_complex_mixed_fixed(tmp_path, setup_path):
8588
tm.assert_frame_equal(df, reread)
8689

8790

88-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
8991
def test_complex_mixed_table(tmp_path, setup_path):
9092
complex64 = np.array(
9193
[1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex64
@@ -140,7 +142,6 @@ def test_complex_across_dimensions(tmp_path, setup_path):
140142
tm.assert_frame_equal(df, reread)
141143

142144

143-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
144145
def test_complex_indexing_error(setup_path):
145146
complex128 = np.array(
146147
[1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j, 1.0 + 1.0j], dtype=np.complex128

pandas/tests/io/pytables/test_errors.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import numpy as np
66
import pytest
77

8+
from pandas._config import using_string_dtype
9+
810
from pandas import (
911
CategoricalIndex,
1012
DataFrame,
@@ -22,7 +24,10 @@
2224
_maybe_adjust_name,
2325
)
2426

25-
pytestmark = pytest.mark.single_cpu
27+
pytestmark = [
28+
pytest.mark.single_cpu,
29+
pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False),
30+
]
2631

2732

2833
def test_pass_spec_to_storer(setup_path):

pandas/tests/io/pytables/test_file_handling.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import numpy as np
44
import pytest
55

6+
from pandas._config import using_string_dtype
7+
68
from pandas.compat import (
79
PY311,
810
is_ci_environment,
@@ -33,7 +35,10 @@
3335
from pandas.io import pytables
3436
from pandas.io.pytables import Term
3537

36-
pytestmark = pytest.mark.single_cpu
38+
pytestmark = [
39+
pytest.mark.single_cpu,
40+
pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False),
41+
]
3742

3843

3944
@pytest.mark.parametrize("mode", ["r", "r+", "a", "w"])

pandas/tests/io/pytables/test_put.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import numpy as np
44
import pytest
55

6+
from pandas._config import using_string_dtype
7+
68
from pandas._libs.tslibs import Timestamp
79

810
import pandas as pd
@@ -22,7 +24,10 @@
2224
)
2325
from pandas.util import _test_decorators as td
2426

25-
pytestmark = pytest.mark.single_cpu
27+
pytestmark = [
28+
pytest.mark.single_cpu,
29+
pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False),
30+
]
2631

2732

2833
def test_format_type(tmp_path, setup_path):

pandas/tests/io/pytables/test_read.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import numpy as np
66
import pytest
77

8+
from pandas._config import using_string_dtype
9+
810
from pandas.compat import is_platform_windows
911

1012
import pandas as pd
@@ -24,7 +26,10 @@
2426

2527
from pandas.io.pytables import TableIterator
2628

27-
pytestmark = pytest.mark.single_cpu
29+
pytestmark = [
30+
pytest.mark.single_cpu,
31+
pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False),
32+
]
2833

2934

3035
def test_read_missing_key_close_store(tmp_path, setup_path):

pandas/tests/io/pytables/test_round_trip.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import numpy as np
55
import pytest
66

7+
from pandas._config import using_string_dtype
8+
79
from pandas._libs.tslibs import Timestamp
810
from pandas.compat import is_platform_windows
911

@@ -24,7 +26,10 @@
2426
)
2527
from pandas.util import _test_decorators as td
2628

27-
pytestmark = pytest.mark.single_cpu
29+
pytestmark = [
30+
pytest.mark.single_cpu,
31+
pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False),
32+
]
2833

2934

3035
def test_conv_read_write():

pandas/tests/io/pytables/test_select.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import numpy as np
22
import pytest
33

4+
from pandas._config import using_string_dtype
5+
46
from pandas._libs.tslibs import Timestamp
57
from pandas.compat import PY312
68

@@ -25,7 +27,10 @@
2527

2628
from pandas.io.pytables import Term
2729

28-
pytestmark = pytest.mark.single_cpu
30+
pytestmark = [
31+
pytest.mark.single_cpu,
32+
pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False),
33+
]
2934

3035

3136
def test_select_columns_in_where(setup_path):

pandas/tests/io/pytables/test_store.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import numpy as np
88
import pytest
99

10+
from pandas._config import using_string_dtype
11+
1012
from pandas.compat import PY312
1113

1214
import pandas as pd
@@ -33,7 +35,10 @@
3335
read_hdf,
3436
)
3537

36-
pytestmark = pytest.mark.single_cpu
38+
pytestmark = [
39+
pytest.mark.single_cpu,
40+
pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False),
41+
]
3742

3843
tables = pytest.importorskip("tables")
3944

pandas/tests/io/pytables/test_timezones.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
ensure_clean_store,
2626
)
2727

28+
pytestmark = pytest.mark.xfail(
29+
using_string_dtype(), reason="TODO(infer_string)", strict=False
30+
)
31+
2832

2933
def _compare_with_tz(a, b):
3034
tm.assert_frame_equal(a, b)
@@ -44,7 +48,6 @@ def _compare_with_tz(a, b):
4448
gettz_pytz = lambda x: x
4549

4650

47-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
4851
@pytest.mark.parametrize("gettz", [gettz_dateutil, gettz_pytz])
4952
def test_append_with_timezones(setup_path, gettz):
5053
# as columns
@@ -219,7 +222,6 @@ def test_tseries_select_index_column(setup_path):
219222
assert rng.tz == result.dt.tz
220223

221224

222-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
223225
def test_timezones_fixed_format_frame_non_empty(setup_path):
224226
with ensure_clean_store(setup_path) as store:
225227
# index
@@ -249,7 +251,6 @@ def test_timezones_fixed_format_frame_non_empty(setup_path):
249251
tm.assert_frame_equal(result, df)
250252

251253

252-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
253254
def test_timezones_fixed_format_empty(setup_path, tz_aware_fixture, frame_or_series):
254255
# GH 20594
255256

@@ -265,7 +266,6 @@ def test_timezones_fixed_format_empty(setup_path, tz_aware_fixture, frame_or_ser
265266
tm.assert_equal(result, obj)
266267

267268

268-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
269269
def test_timezones_fixed_format_series_nonempty(setup_path, tz_aware_fixture):
270270
# GH 20594
271271

@@ -318,7 +318,6 @@ def test_store_timezone(setup_path):
318318
tm.assert_frame_equal(result, df)
319319

320320

321-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
322321
def test_dst_transitions(setup_path):
323322
# make sure we are not failing on transitions
324323
with ensure_clean_store(setup_path) as store:
@@ -339,7 +338,6 @@ def test_dst_transitions(setup_path):
339338
tm.assert_frame_equal(result, df)
340339

341340

342-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
343341
def test_read_with_where_tz_aware_index(tmp_path, setup_path):
344342
# GH 11926
345343
periods = 10

pandas/tests/io/test_clipboard.py

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import numpy as np
44
import pytest
55

6+
from pandas._config import using_string_dtype
7+
68
from pandas.errors import (
79
PyperclipException,
810
PyperclipWindowsException,
@@ -28,6 +30,10 @@
2830
init_qt_clipboard,
2931
)
3032

33+
pytestmark = pytest.mark.xfail(
34+
using_string_dtype(), reason="TODO(infer_string)", strict=False
35+
)
36+
3137

3238
def build_kwargs(sep, excel):
3339
kwargs = {}

pandas/tests/io/test_feather.py

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import numpy as np
66
import pytest
77

8+
from pandas._config import using_string_dtype
9+
810
import pandas as pd
911
import pandas._testing as tm
1012
from pandas.core.arrays import (
@@ -146,6 +148,7 @@ def test_path_pathlib(self):
146148
result = tm.round_trip_pathlib(df.to_feather, read_feather)
147149
tm.assert_frame_equal(df, result)
148150

151+
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
149152
def test_passthrough_keywords(self):
150153
df = pd.DataFrame(
151154
1.1 * np.arange(120).reshape((30, 4)),
@@ -164,6 +167,7 @@ def test_http_path(self, feather_file, httpserver):
164167
res = read_feather(httpserver.url)
165168
tm.assert_frame_equal(expected, res)
166169

170+
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False)
167171
def test_read_feather_dtype_backend(self, string_storage, dtype_backend):
168172
# GH#50765
169173
df = pd.DataFrame(

pandas/tests/io/test_fsspec.py

+1
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def test_s3_protocols(s3_public_bucket_with_data, tips_file, protocol, s3so):
262262
)
263263

264264

265+
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
265266
@pytest.mark.single_cpu
266267
def test_s3_parquet(s3_public_bucket, s3so, df1):
267268
pytest.importorskip("fastparquet")

0 commit comments

Comments
 (0)