Skip to content

Commit

Permalink
Parameterize the columns.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Oct 25, 2021
1 parent 3fac33b commit ea0d075
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/cudf/cudf/tests/test_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ def test_series_nsmallest(data, n):

@pytest.mark.parametrize("nelem,n", [(1, 1), (100, 100), (10, 5), (100, 10)])
@pytest.mark.parametrize("op", ["nsmallest", "nlargest"])
def test_dataframe_nlargest_nsmallest(nelem, n, op):
@pytest.mark.parametrize("columns", ["a", ["b", "a"]])
def test_dataframe_nlargest_nsmallest(nelem, n, op, columns):
np.random.seed(0)
aa = np.random.random(nelem)
bb = np.random.random(nelem)

df = DataFrame({"a": aa, "b": bb})
pdf = df.to_pandas()
assert_eq(getattr(df, op)(n, "a"), getattr(pdf, op)(n, "a"))
assert_eq(getattr(df, op)(n, ["b", "a"]), getattr(pdf, op)(n, ["b", "a"]))
assert_eq(getattr(df, op)(n, columns), getattr(pdf, op)(n, columns))


@pytest.mark.parametrize(
Expand Down

0 comments on commit ea0d075

Please sign in to comment.