
tinymo.us
»Subscribe to RSS feed. So you want to mock python’s open. It’s kind of silly. You can’t use the decorator form of mock.patch since this version doesn’t return anything, so you have to use the context manager version. mock open = mock.mock open() with mock.patch(‘your.module.path.open’, mock open, create=True): thing.you are testing that uses open(your, params, here) mock open.assert…. Must Read This Later. A comparison of scripting languages. Bad Error Message is Unhelpful. New vs. init. New vs. init.
http://www.tinymo.us/
SOCIAL ENGAGEMENT