Message259268
Regarding the documentation changes, my version simply mocks `open` more "closely", so for the most part I can't think of any changes to the documentation. I've added a bit about the mock object acting as a map of file names to mock objects. Should I add anything else?
Regarding the tests, I've tried changing as little as possible to make sure I don't have any backward compatibility issues. However, some changes had to be made:
* By default, `open`'s mode is 'r', the new mock_open imitates this behavior, and so the test shows. Also, calling `open` as a context manager will call `close` in `__exit__`. These are the majority of changes to the testing code.
* test_mock_open_write and test_mock_open_read_with_argument: These functionalities' testing is taken care of by the new mock_open tests.
* test_readlines_data: I removed the `create` argument to `patch`. Must've been by accident. Fixed this in the new patch.
Sorry about the (very) late response, I've been preoccupied lately. |
|
Date |
User |
Action |
Args |
2016-01-30 20:39:41 | Niv Ben-David | set | recipients:
+ Niv Ben-David, rbcollins, ezio.melotti, r.david.murray, michael.foord |
2016-01-30 20:39:38 | Niv Ben-David | set | messageid: <1454186378.99.0.888055169066.issue25690@psf.upfronthosting.co.za> |
2016-01-30 20:39:38 | Niv Ben-David | link | issue25690 messages |
2016-01-30 20:39:38 | Niv Ben-David | create | |
|