Skip to content

Commit 29afd36

Browse files
Unit test updates according to PR
1 parent d874ef7 commit 29afd36

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pandas/tests/groupby/test_function.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,11 @@ def test_groupby_non_arithmetic_agg_int_like_precision(i):
400400
assert res.iloc[0].b == data["expected"]
401401

402402

403-
@pytest.mark.parametrize("func, expected", [
403+
@pytest.mark.parametrize("func, values", [
404404
("idxmin", {'c_int': [0, 2], 'c_float': [1, 3], 'c_date': [1, 2]}),
405405
("idxmax", {'c_int': [1, 3], 'c_float': [0, 2], 'c_date': [0, 3]})
406406
])
407-
def test_idxmin_idxmax_returns_int_types(func, expected):
407+
def test_idxmin_idxmax_returns_int_types(func, values):
408408
# GH 25444
409409
df = pd.DataFrame({'name': ['A', 'A', 'B', 'B'],
410410
'c_int': [1, 2, 3, 4],
@@ -414,12 +414,9 @@ def test_idxmin_idxmax_returns_int_types(func, expected):
414414

415415
result = getattr(df.groupby('name'), func)()
416416

417-
for col in result:
418-
assert result[col].dtype == np.int64
417+
expected = pd.DataFrame(values, index=Index(['A', 'B'], name="name"))
419418

420-
df_expected = pd.DataFrame(expected, index=Index(['A', 'B'], name="name"))
421-
422-
tm.assert_frame_equal(result, df_expected)
419+
tm.assert_frame_equal(result, expected)
423420

424421

425422
def test_fill_consistency():

0 commit comments

Comments
 (0)