Skip to content

Commit a290885

Browse files
gfyoungproost
authored andcommitted
TST: Test Series integer mod behavior on string (pandas-dev#29180)
1 parent 4dad3ca commit a290885

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/series/test_operators.py

+11
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,17 @@ def test_divmod(self):
878878
assert_series_equal(result[0], expected[0])
879879
assert_series_equal(result[1], expected[1])
880880

881+
@pytest.mark.parametrize("index", [None, range(9)])
882+
def test_series_integer_mod(self, index):
883+
# see gh-24396
884+
s1 = Series(range(1, 10))
885+
s2 = Series("foo", index=index)
886+
887+
msg = "not all arguments converted during string formatting"
888+
889+
with pytest.raises(TypeError, match=msg):
890+
s2 % s1
891+
881892

882893
class TestSeriesUnaryOps:
883894
# __neg__, __pos__, __inv__

0 commit comments

Comments
 (0)