Skip to content

Commit 04f3d9d

Browse files
committed
Fix tests
1 parent c89da87 commit 04f3d9d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/tests/frame/test_reductions.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,14 +590,15 @@ def test_mode_dropna(self, dropna, expected):
590590
expected = DataFrame(expected)
591591
tm.assert_frame_equal(result, expected)
592592

593-
def test_mode_sortwarning(self):
593+
def test_mode_sortwarning(self, using_infer_string):
594594
# Check for the warning that is raised when the mode
595595
# results cannot be sorted
596596

597597
df = DataFrame({"A": [np.nan, np.nan, "a", "a"]})
598598
expected = DataFrame({"A": ["a", np.nan]})
599599

600-
with tm.assert_produces_warning(UserWarning):
600+
warning = None if using_infer_string else UserWarning
601+
with tm.assert_produces_warning(warning):
601602
result = df.mode(dropna=False)
602603
result = result.sort_values(by="A").reset_index(drop=True)
603604

@@ -1273,7 +1274,8 @@ def test_any_datetime(self):
12731274
def test_any_all_bool_only(self):
12741275
# GH 25101
12751276
df = DataFrame(
1276-
{"col1": [1, 2, 3], "col2": [4, 5, 6], "col3": [None, None, None]}
1277+
{"col1": [1, 2, 3], "col2": [4, 5, 6], "col3": [None, None, None]},
1278+
columns=Index(["col1", "col2", "col3"], dtype=object),
12771279
)
12781280

12791281
result = df.all(bool_only=True)

0 commit comments

Comments
 (0)