Skip to content

Commit a616b29

Browse files
committed
match exact error message on test
1 parent c6cb4b9 commit a616b29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/tests/series/accessors/test_str_accessor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def test_str_attribute(self):
1515

1616
# str accessor only valid with string values
1717
ser = Series(range(5))
18-
with pytest.raises(AttributeError, match="only use .str accessor"):
18+
msg = "Can only use .str accessor with string values, not integer"
19+
with pytest.raises(AttributeError, match=msg):
1920
ser.str.repeat(2)
2021

2122
def test_str_accessor_updates_on_inplace(self):

0 commit comments

Comments
 (0)