From ca74fcf03949e1e70e6fa5fab552b4e0449027ab Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Thu, 11 Jul 2024 16:48:07 -0600 Subject: [PATCH] Make sure != is tested in test_eq --- ndindex/tests/test_ndindex.py | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/ndindex/tests/test_ndindex.py b/ndindex/tests/test_ndindex.py index 6b111a4b..14228100 100644 --- a/ndindex/tests/test_ndindex.py +++ b/ndindex/tests/test_ndindex.py @@ -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)