Skip to content

Commit a238051

Browse files
committed
Apply fix from test_arith_series_with_scalar() to new method test_arith_frame_with_scalar()
1 parent 777ac2f commit a238051

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

text_extensions_for_pandas/array/test_tensor.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,15 +1051,24 @@ def test_arith_series_with_scalar(self, data, all_arithmetic_operators):
10511051
s = pd.Series(data[1:]) # Avoid zero values for div
10521052
self.check_opname(s, op_name, s.iloc[0], exc=self.series_scalar_exc)
10531053

1054+
def test_arith_frame_with_scalar(self, data, all_arithmetic_operators):
1055+
""" Override to prevent div by zero warning."""
1056+
# frame & scalar
1057+
op_name = all_arithmetic_operators
1058+
df = pd.DataFrame({"A": data[1:]}) # Avoid zero values for div
1059+
self.check_opname(df, op_name, data[0], exc=self.frame_scalar_exc)
1060+
10541061
def test_arith_series_with_array(self, data, all_arithmetic_operators):
1055-
""" Override because creates Series from list of TensorElements as dtype=object."""
1062+
""" Override because creates Series from list of TensorElements as
1063+
dtype=object."""
10561064
# ndarray & other series
10571065
op_name = all_arithmetic_operators
10581066
s = pd.Series(data[1:]) # Avoid zero values for div
10591067
self.check_opname(
10601068
s, op_name, pd.Series([s.iloc[0]] * len(s), dtype=TensorDtype()), exc=self.series_array_exc
10611069
)
10621070

1071+
10631072
@pytest.mark.skip(reason="TensorArray does not error on ops")
10641073
def test_error(self, data, all_arithmetic_operators):
10651074
# other specific errors tested in the TensorArray specific tests

0 commit comments

Comments
 (0)