from unittest.mock import Mock attrs = {'__hash__.return_value': "FIXME"} mock = Mock(**attrs)