Skip to content

Commit

Permalink
make test order independant
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Apr 3, 2019
1 parent c705bc7 commit fef2fe7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/value_counts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def test_value_counts_simple():
assert ds.x.value_counts(dropna=False, ascending=True).values.tolist() == [1, 1, 2, 3]

# print(ds.s.value_counts(dropna=True, ascending=True))
assert ds.s.value_counts(dropna=True, ascending=True).index.tolist() == ['0.0', 'nan', '1.0', '2.0']
assert ds.s.value_counts(dropna=True, ascending=True).values.tolist() == [1, 1.0, 2, 3]
assert set(ds.s.value_counts(dropna=True, ascending=True).index.tolist()) == {'0.0', 'nan', '1.0', '2.0'}
assert set(ds.s.value_counts(dropna=True, ascending=True).values.tolist()) == {1, 1.0, 2, 3}

assert ds.y.value_counts(dropna=True, ascending=True).index.tolist() == [1, 2]
assert ds.y.value_counts(dropna=True, ascending=True).values.tolist() == [1, 3]
assert set(ds.y.value_counts(dropna=True, ascending=True).index.tolist()) == {1, 2}
assert set(ds.y.value_counts(dropna=True, ascending=True).values.tolist()) == {1, 3}
# nan comparison with == never works
# assert ds.y.value_counts(dropna=False, ascending=True).index.tolist() == [1, np.nan, None, 2]
assert ds.y.value_counts(dropna=False, dropnull=True, ascending=True).values.tolist() == [1, 1, 3]
Expand Down

0 comments on commit fef2fe7

Please sign in to comment.