From 6b8e1f4bcc5ae851abea99441815382d43e2b243 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sun, 27 Oct 2013 21:11:28 -0400 Subject: Remove __eq__, since it causes hashability issues on Py3 that I don't want to deal with at the moment. --- jsonschema/exceptions.py | 8 -------- jsonschema/tests/test_exceptions.py | 3 ++- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/jsonschema/exceptions.py b/jsonschema/exceptions.py index 04a3c0b..26fafbe 100644 --- a/jsonschema/exceptions.py +++ b/jsonschema/exceptions.py @@ -28,14 +28,6 @@ class _Error(Exception): self.instance = instance self.schema = schema - def __eq__(self, other): - if not isinstance(other, self.__class__): - return NotImplemented - return self._contents() == other._contents() - - def __ne__(self, other): - return not self == other - def __repr__(self): return "<%s: %r>" % (self.__class__.__name__, self.message) diff --git a/jsonschema/tests/test_exceptions.py b/jsonschema/tests/test_exceptions.py index b3f176d..2014a64 100644 --- a/jsonschema/tests/test_exceptions.py +++ b/jsonschema/tests/test_exceptions.py @@ -149,7 +149,8 @@ class TestBestMatch(unittest.TestCase): validator = Draft4Validator({"minProperties" : 2}) error, = validator.iter_errors({}) self.assertEqual( - exceptions.best_match(validator.iter_errors({})), error, + exceptions.best_match(validator.iter_errors({})).validator, + "minProperties", ) def test_no_errors(self): -- cgit v1.2.1