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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 1 addition & 3 deletions
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

Lines changed: 6 additions & 1 deletion
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

Lines changed: 6 additions & 1 deletion
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

Lines changed: 4 additions & 3 deletions
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

Lines changed: 6 additions & 1 deletion
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

Lines changed: 6 additions & 1 deletion
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

Lines changed: 6 additions & 1 deletion
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

Lines changed: 6 additions & 1 deletion
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

Lines changed: 6 additions & 1 deletion
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():

0 commit comments

Comments
 (0)