From 8a1837c7dcad8e702ea5adf22ce135ae25c7acc6 Mon Sep 17 00:00:00 2001 From: Jeff Reback Date: Tue, 6 Feb 2018 18:19:11 -0500 Subject: [PATCH] test for Series with broadcast=True, raises when passed incorrect shape --- pandas/tests/frame/test_apply.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandas/tests/frame/test_apply.py b/pandas/tests/frame/test_apply.py index f11526eab66c1..a8d255428f5c6 100644 --- a/pandas/tests/frame/test_apply.py +++ b/pandas/tests/frame/test_apply.py @@ -198,6 +198,11 @@ def test_apply_broadcast_error(self): axis=1, result_type='broadcast') + with pytest.raises(ValueError): + df.apply(lambda x: Series([1, 2]), + axis=1, + result_type='broadcast') + def test_apply_raw(self): result0 = self.frame.apply(np.mean, raw=True) result1 = self.frame.apply(np.mean, axis=1, raw=True)