Message228226
I can, as shown in workaround #2.
However it's hackey when true side-effect's own return value has nothing in common with return value for the mock.
The shortest workaround I managed is this:
mock.Mock(side_effect=lambda *arg: db.update(...) or my_return_value) # relies on db.update returning None
or more explicit like this:
mock.Mock(side_effect=lamda *arg: db.update(...) or mock.DEFAULT, return_value=my_return_value) # -"- |
|
Date |
User |
Action |
Args |
2014-10-02 13:51:43 | Dima.Tisnek | set | recipients:
+ Dima.Tisnek, r.david.murray |
2014-10-02 13:51:43 | Dima.Tisnek | set | messageid: <1412257903.44.0.561604935256.issue22541@psf.upfronthosting.co.za> |
2014-10-02 13:51:43 | Dima.Tisnek | link | issue22541 messages |
2014-10-02 13:51:43 | Dima.Tisnek | create | |
|