标签: python mocking
我一直在使用patch.object(obj, attribute)来修补obj的属性:
patch.object(obj, attribute)
obj
with patch.object(StorageSaver, 'save_listing'): ImportJob.objects.import_feed(feed.id)
但有没有办法修补整个obj?例如
with patch.object(StorageSaver): ...