Author idanweiss97
Recipients idanweiss97, python-dev
Date 2020-12-03.12:20:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606998026.09.0.31549028921.issue42532@roundup.psfhosted.org>
In-reply-to
Content
To reproduce:
import unittest.mock


class LogicInBool:
    def __bool__(self):
        print("In Bool!")
        return True

class SomeClass:
    def __init__(self):
        self.logic_in_bool = LogicInBool()

obj = SomeClass()
with unittest.mock.patch.object(obj, 'logic_in_bool', autospec=True):
    # "In Bool! is printed
    pass
History
Date User Action Args
2020-12-03 12:20:26idanweiss97setrecipients: + idanweiss97, python-dev
2020-12-03 12:20:26idanweiss97setmessageid: <1606998026.09.0.31549028921.issue42532@roundup.psfhosted.org>
2020-12-03 12:20:26idanweiss97linkissue42532 messages
2020-12-03 12:20:26idanweiss97create