Skip to content

Commit

Permalink
Make sure != is tested in test_eq
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed Jul 11, 2024
1 parent a1379ac commit ca74fcf
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions ndindex/tests/test_ndindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,25 @@ def test_eq(idx):
else:
assert new.raw == index.raw

assert (new == index)
assert (new.raw == index)
assert (new == index.raw)
assert (index == new)
assert (index.raw == new)
assert (index == new.raw)

assert (index.raw == index)
def assert_equal(a, b):
assert a == b
assert b == a
assert not (a != b)
assert not (b != a)

def assert_not_equal(a, b):
assert a != b
assert b != a
assert not (a == b)
assert not (b == a)

assert_equal(new, index)
assert_equal(new.raw, index)
assert_equal(new, index.raw)

assert_equal(index.raw, index)
assert hash(new) == hash(index)
assert (index == index.raw)
assert not (index == 'a')
assert not ('a' == index)
assert (index != 'a')
assert ('a' != index)
assert_not_equal(index, 'a')

try:
h = hash(idx)
Expand Down

0 comments on commit ca74fcf

Please sign in to comment.