8000 Remove TestData in series tests indexing by SaturnFromTitan · Pull Request #29220 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Remove TestData in series tests indexing #29220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prev Previous commit
Next Next commit
replaced test_data fixture with more granular fixtures in pandas/test…
…s/series/indexing/test_numeric.py
  • Loading branch information
SaturnFromTitan committed Oct 25, 2019
commit ce20213c1b3121e9c7fcc57b63c183ea54665206
14 changes: 7 additions & 7 deletions pandas/tests/series/indexing/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,22 @@ def test_setitem_float_labels():
assert_series_equal(s, tmp)


def test_slice_float_get_set(test_data):
def test_slice_float_get_set(datetime_series):
msg = (
r"cannot do slice indexing on <class 'pandas\.core\.indexes"
r"\.datetimes\.DatetimeIndex'> with these indexers \[{key}\]"
r" of <class 'float'>"
)
with pytest.raises(TypeError, match=msg.format(key=r"4\.0")):
test_data.ts[4.0:10.0]
datetime_series[4.0:10.0]

with pytest.raises(TypeError, match=msg.format(key=r"4\.0")):
test_data.ts[4.0:10.0] = 0
datetime_series[4.0:10.0] = 0

with pytest.raises(TypeError, match=msg.format(key=r"4\.5")):
test_data.ts[4.5:10.0]
datetime_series[4.5:10.0]
with pytest.raises(TypeError, match=msg.format(key=r"4\.5")):
test_data.ts[4.5:10.0] = 0
datetime_series[4.5:10.0] = 0


def test_slice_floats2():
Expand Down Expand Up @@ -312,6 +312,6 @@ def test_int_indexing():
s["c"]


def test_getitem_int64(test_data):
def test_getitem_int64(datetime_series):
idx = np.int64(5)
assert test_data.ts[idx] == test_data.ts[5]
assert datetime_series[idx] == datetime_series[5]
0