def test_order_without_eq(self): """ eq=False, order=True raises a meaningful ValueError. """ with pytest.raises( ValueError, match="`order` can only be True if `eq` is True too." ): _determine_eq_order(None, False, True)
def test_mix(self, cmp, eq, order): """ If cmp is not None, eq and order must be None and vice versa. """ assume(eq is not None or order is not None) with pytest.raises(ValueError, match="Don't mix `cmp` with `eq' and `order`."): _determine_eq_order(cmp, eq, order)
def test_order_mirrors_eq_by_default(self, eq): """ If order is None, it mirrors eq. """ assert (eq, eq) == _determine_eq_order(None, eq, None)
def test_default(self): """ If all are set to None, do the default: True, True """ assert (True, True) == _determine_eq_order(None, None, None)