Message332848
Is there a problem with:
from unittest import mock
class SomeClass:
def do_something(self, x):
pass
def some_function(x):
obj = SomeClass()
y = obj.do_something(x)
return y
def do_something_side_effect(self, x):
print(self)
return x
def test_some_function():
with mock.patch.object(SomeClass, "do_something", do_something_side_effect):
assert some_function(1)
? |
|
Date |
User |
Action |
Args |
2019-01-02 00:41:15 | remi.lapeyre | set | recipients:
+ remi.lapeyre, Adnan Umer |
2019-01-02 00:41:14 | remi.lapeyre | set | messageid: <1546389674.0.0.241829722582.issue35577@roundup.psfhosted.org> |
2019-01-02 00:41:13 | remi.lapeyre | link | issue35577 messages |
2019-01-02 00:41:13 | remi.lapeyre | create | |
|