- def _test_binop_invalid_unknown(self, op):
- if op in _COMP_BINOPS:
- self.skipTest('not testing')
-
- with self.assertRaises(TypeError):
- op(self._def, object())
-
- def _test_binop_invalid_none(self, op):
- if op in _COMP_BINOPS:
- self.skipTest('not testing')
-
- with self.assertRaises(TypeError):
- op(self._def, None)
+ def _test_binop_unknown(self, op):
+ if op is operator.eq:
+ self.assertIs(op(self._def, object()), False)
+ elif op is operator.ne:
+ self.assertIs(op(self._def, object()), True)
+ else:
+ with self.assertRaises(TypeError):
+ op(self._def, object())
+
+ def _test_binop_none(self, op):
+ if op is operator.eq:
+ self.assertIs(op(self._def, None), False)
+ elif op is operator.ne:
+ self.assertIs(op(self._def, None), True)
+ else:
+ with self.assertRaises(TypeError):
+ op(self._def, None)