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

🐛 SAT: Update DictWithHash class in test_sequential_reads #5738

Merged
merged 5 commits into from
Sep 3, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#


import functools
import json
from typing import List, Mapping, Optional

Expand Down Expand Up @@ -70,6 +71,7 @@ def diff_dicts(left, right, use_markup) -> Optional[List[str]]:
return ["equals failed"] + [color_off + line for line in icdiff_lines]


@functools.total_ordering
class DictWithHash(dict):

_hash: str = None
Expand All @@ -82,6 +84,9 @@ def __hash__(self):
def __lt__(self, other):
return hash(self) < hash(other)

def __eq__(self, other):
return hash(self) == hash(other)


def serialize(value) -> str:
"""Simplify comparison of nested dicts/lists"""
Expand Down