Skip to content

Commit 19767bb

Browse files
GH1149 Add testing for pd.Series.str behavior (#1272)
* GH1149 Add testing for pd.Series.str behavior * GH1149 run pre-commit * GH1149 modify test name
1 parent f6dd4a2 commit 19767bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_series.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3975,3 +3975,11 @@ def test_timedelta_index_cumprod() -> None:
39753975

39763976
if TYPE_CHECKING_INVALID_USAGE:
39773977
assert_type(as_period_series.cumprod(), Never)
3978+
3979+
3980+
def test_series_str_methods() -> None:
3981+
"""Test the returns of StringMethods match the type of the input series GH1149."""
3982+
s_str = pd.Series(["a", "b"])
3983+
check(assert_type(s_str, "pd.Series[str]"), pd.Series, str)
3984+
check(assert_type(s_str.str.upper(), "pd.Series[str]"), pd.Series, str)
3985+
check(assert_type(s_str.str.lower(), "pd.Series[str]"), pd.Series, str)

0 commit comments

Comments
 (0)