Message261825
I copied the code in place of the old mock_open in unittest/mock.py.
Regarding the VFS issue, I think that it really depends on what you're trying to test. If you only care about "side effects" on the file system, the VFS way it much better and easier. But if you want to test the way files are handled by your code (proper handling of errors during open/read/write seems the obvious thing here, but I can think of other use cases), then I think MockOpen is the better tool. |
|
Date |
User |
Action |
Args |
2016-03-15 19:54:16 | Niv Ben-David | set | recipients:
+ Niv Ben-David, rbcollins, ezio.melotti, r.david.murray, michael.foord |
2016-03-15 19:54:14 | Niv Ben-David | set | messageid: <1458071655.0.0.816808426925.issue25690@psf.upfronthosting.co.za> |
2016-03-15 19:54:14 | Niv Ben-David | link | issue25690 messages |
2016-03-15 19:54:14 | Niv Ben-David | create | |
|