Skip to content

Commit a53604d

Browse files
[backport 2.3.x] TST (string dtype): avoid hardcoded object dtype for columns in datetime_frame fixture (#60192) (#60198)
TST (string dtype): avoid hardcoded object dtype for columns in datetime_frame fixture (#60192) (cherry picked from commit 34387bd)
1 parent 6f4ebe6 commit a53604d

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

pandas/tests/frame/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def datetime_frame() -> DataFrame:
1818
"""
1919
return DataFrame(
2020
np.random.default_rng(2).standard_normal((100, 4)),
21-
columns=Index(list("ABCD"), dtype=object),
21+
columns=Index(list("ABCD")),
2222
index=date_range("2000-01-01", periods=100, freq="B"),
2323
)
2424

pandas/tests/frame/indexing/test_indexing.py

-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ def test_getitem_boolean(self, mixed_float_frame, mixed_int_frame, datetime_fram
183183
if bif[c].dtype != bifw[c].dtype:
184184
assert bif[c].dtype == df[c].dtype
185185

186-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
187186
def test_getitem_boolean_casting(self, datetime_frame):
188187
# don't upcast if we don't need to
189188
df = datetime_frame.copy()

pandas/tests/frame/methods/test_to_csv.py

-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def read_csv(self, path, **kwargs):
3535

3636
return read_csv(path, **params)
3737

38-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
3938
def test_to_csv_from_csv1(self, float_frame, datetime_frame):
4039
with tm.ensure_clean("__tmp_to_csv_from_csv1__") as path:
4140
float_frame.iloc[:5, float_frame.columns.get_loc("A")] = np.nan
@@ -533,7 +532,6 @@ def test_to_csv_headers(self):
533532
assert return_value is None
534533
tm.assert_frame_equal(to_df, recons)
535534

536-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)")
537535
def test_to_csv_multiindex(self, float_frame, datetime_frame):
538536
frame = float_frame
539537
old_index = frame.index

0 commit comments

Comments
 (0)