Skip to content

Commit

Permalink
Fix hash
Browse files Browse the repository at this point in the history
  • Loading branch information
fornellas committed Feb 19, 2021
1 parent 71aace9 commit 98fbad3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion testslide/strict_mock.py
Expand Up @@ -489,16 +489,18 @@ def __setup_subclass(self):
break
for name in klass.__dict__.keys():
if name in [
"__module__",
"__doc__",
"__init__",
"__module__",
]:
continue
# https://docs.python.org/3/tutorial/classes.html#tut-private
if name.startswith(f"_{type(self).__name__}__") and not name.endswith(
"__"
):
continue
if name == "__hash__" and klass.__dict__["__hash__"] is None:
continue
StrictMock.__setattr__(self, name, getattr(self, name))

def __init__(
Expand Down

0 comments on commit 98fbad3

Please sign in to comment.