Skip to content

Commit

Permalink
[#22550] Remove TestData from series-tests test_operators.py (#29084)
Browse files Browse the repository at this point in the history
  • Loading branch information
SaturnFromTitan authored and jreback committed Oct 19, 2019
1 parent 930dd84 commit 7c8c8c8
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pandas/tests/series/test_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
assert_series_equal,
)

from .common import TestData


class TestSeriesLogicalOps:
@pytest.mark.parametrize("bool_op", [operator.and_, operator.or_, operator.xor])
Expand Down Expand Up @@ -746,7 +744,7 @@ def test_comparison_flex_alignment_fill(self):
assert_series_equal(left.gt(right, fill_value=0), exp)


class TestSeriesOperators(TestData):
class TestSeriesOperators:
def test_operators_empty_int_corner(self):
s1 = Series([], [], dtype=np.int32)
s2 = Series({"x": 0.0})
Expand All @@ -768,12 +766,10 @@ def test_ops_datetimelike_align(self):
result = (dt2.to_frame() - dt.to_frame())[0]
assert_series_equal(result, expected)

def test_operators_corner(self):
series = self.ts

def test_operators_corner(self, datetime_series):
empty = Series([], index=Index([]))

result = series + empty
result = datetime_series + empty
assert np.isnan(result).all()

result = empty + Series([], index=Index([]))
Expand All @@ -786,10 +782,12 @@ def test_operators_corner(self):
# deltas = deltas + sub_deltas

# float + int
int_ts = self.ts.astype(int)[:-5]
added = self.ts + int_ts
int_ts = datetime_series.astype(int)[:-5]
added = datetime_series + int_ts
expected = Series(
self.ts.values[:-5] + int_ts.values, index=self.ts.index[:-5], name="ts"
datetime_series.values[:-5] + int_ts.values,
index=datetime_series.index[:-5],
name="ts",
)
tm.assert_series_equal(added[:-5], expected)

Expand Down

0 comments on commit 7c8c8c8

Please sign in to comment.