Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the tests working? #58

Closed
pecalleja opened this issue Mar 23, 2023 · 2 comments · Fixed by #61
Closed

Are the tests working? #58

pecalleja opened this issue Mar 23, 2023 · 2 comments · Fixed by #61

Comments

@pecalleja
Copy link

I cloned the project and executed the tests but it's not working. do you have any advice?

$ pytest -vv

output

self = <tests.test_jsondiff.JsonDiffTests testMethod=test_a>

    def test_a(self):

        self.assertEqual({}, diff(1, 1))
        self.assertEqual({}, diff(True, True))
        self.assertEqual({}, diff('abc', 'abc'))
        self.assertEqual({}, diff([1, 2], [1, 2]))
        self.assertEqual({}, diff((1, 2), (1, 2)))
        self.assertEqual({}, diff({1, 2}, {1, 2}))
        self.assertEqual({}, diff({'a': 1, 'b': 2}, {'a': 1, 'b': 2}))
        self.assertEqual({}, diff([], []))
        self.assertEqual({}, diff(None, None))
        self.assertEqual({}, diff({}, {}))
        self.assertEqual({}, diff(set(), set()))

        self.assertEqual(2, diff(1, 2))
        self.assertEqual(False, diff(True, False))
        self.assertEqual('def', diff('abc', 'def'))
        self.assertEqual([3, 4], diff([1, 2], [3, 4]))
        self.assertEqual((3, 4), diff((1, 2), (3, 4)))
        self.assertEqual({3, 4}, diff({1, 2}, {3, 4}))
>       self.assertEqual({replace: {'c': 3, 'd': 4}}, diff({'a': 1, 'b': 2}, {'c': 3, 'd': 4}))
E       TypeError: unhashable type: 'Symbol'

tests/test_jsondiff.py:45: TypeError
@ramwin
Copy link
Contributor

ramwin commented Apr 26, 2023

I met the same problme.

corytodd pushed a commit to corytodd/jsondiff that referenced this issue Jun 2, 2023
In xlwings#55 an equality method was introduced without a corresponding hash
method. Hashable objects that implement __eq__ must also implement
__hash__ if the type is immutable [1]. Implement hash using the label
field which is now a property in order to convey the intent of
immutability.

Fixes xlwings#58

[1] https://docs.python.org/3/reference/datamodel.html#object.__hash__

Signed-off-by: Cory Todd <cory.todd@canonical.com>
@corytodd
Copy link
Collaborator

corytodd commented Jun 2, 2023

This was broken by #55 and fixed by #61.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants