Skip to content
10 changes: 8 additions & 2 deletions tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3996,7 +3996,6 @@ def test_hashable_args() -> None:
df.columns = ["test"] # type: ignore[assignment]

testDict = {"test": 1}

with ensure_clean() as path:
df.to_string(path, col_space=testDict)
df.to_string(path, col_space={"test": 1})
Expand All @@ -4011,7 +4010,14 @@ def test_transpose() -> None:
df = pd.DataFrame({"a": [1, 1, 2], "b": [4, 5, 6]})
check(assert_type(df.transpose(), pd.DataFrame), pd.DataFrame)
check(assert_type(df.transpose(None), pd.DataFrame), pd.DataFrame)
check(assert_type(df.transpose(copy=True), pd.DataFrame), pd.DataFrame)

msg = "The copy keyword is deprecated and will be removed in a future"
with pytest_warns_bounded(
DeprecationWarning,
msg,
lower="2.2.99",
):
check(assert_type(df.transpose(copy=True), pd.DataFrame), pd.DataFrame)


def test_combine() -> None:
Expand Down
10 changes: 9 additions & 1 deletion tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3714,6 +3714,14 @@ def test_align() -> None:
aligned_s0, aligned_s1 = s0.align(s1)
check(assert_type(aligned_s0, pd.Series), pd.Series)
check(assert_type(aligned_s1, pd.Series), pd.Series)
aligned_s0, aligned_s1 = s0.align(s1, fill_value=0, axis=0, level=0, copy=False)

msg = "The copy keyword is deprecated and will be removed in a future version.*"
with pytest_warns_bounded(
DeprecationWarning,
msg,
lower="2.2.99",
):
aligned_s0, aligned_s1 = s0.align(s1, fill_value=0, axis=0, level=0, copy=False)

check(assert_type(aligned_s0, pd.Series), pd.Series)
check(assert_type(aligned_s1, pd.Series), pd.Series)