Skip to content

Commit dc2b74e

Browse files
authored
REF: misplaced arithmetic tests (#32912)
1 parent 55df1e8 commit dc2b74e

File tree

5 files changed

+425
-424
lines changed

5 files changed

+425
-424
lines changed

pandas/tests/frame/test_arithmetic.py

+9
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,15 @@ def test_arith_flex_zero_len_raises(self):
530530
with pytest.raises(NotImplementedError, match="fill_value"):
531531
df_len0.sub(df["A"], axis=None, fill_value=3)
532532

533+
def test_flex_add_scalar_fill_value(self):
534+
# GH#12723
535+
dat = np.array([0, 1, np.nan, 3, 4, 5], dtype="float")
536+
df = pd.DataFrame({"foo": dat}, index=range(6))
537+
538+
exp = df.fillna(0).add(2)
539+
res = df.add(2, fill_value=0)
540+
tm.assert_frame_equal(res, exp)
541+
533542

534543
class TestFrameArithmetic:
535544
def test_td64_op_nat_casting(self):

pandas/tests/frame/test_missing.py

-9
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,3 @@ def test_fill_corner(self, float_frame, float_string_frame):
694694

695695
# TODO(wesm): unused?
696696
result = empty_float.fillna(value=0) # noqa
697-
698-
def test_fill_value_when_combine_const(self):
699-
# GH12723
700-
dat = np.array([0, 1, np.nan, 3, 4, 5], dtype="float")
701-
df = DataFrame({"foo": dat}, index=range(6))
702-
703-
exp = df.fillna(0).add(2)
704-
res = df.add(2, fill_value=0)
705-
tm.assert_frame_equal(res, exp)

0 commit comments

Comments
 (0)