Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
proxy() does not play well with mock objects #26
Execution completely freezes up when trying to get a proxy of an actor that's got a bit of constructor injection going on.
I'm specifically using Voidspace mock's
# ... mock_credit_card_processor = MagicMock() foobar = Foobar.start(mock_credit_card_processor) foobar.proxy() # blocked indefinitely here! # ...
... where the code to
class FooBar(pykka.ThreadingActor): def __init__(self, credit_card_processor): super(FooBar, self).__init__() self.credit_card_processor = credit_card_processor
I suspect because mock objects don't behave as pykka expects members to behave when doing introspection.
Yeah, there's a conflict between
To update your example:
# ... mock_credit_card_processor = MagicMock(spec=RealCreditCardProcessor) foobar = Foobar.start(mock_credit_card_processor, msg_captor) foobar.proxy() # ...