Skip to content

v1.3.0

Compare
Choose a tag to compare
@nivbend nivbend released this 21 Nov 16:39
· 19 commits to master since this release

Update

Submitted as a patch to python.

Changed

  • Used mock wrapping for file operations (seek, read, etc.) instead of side_effect. Now there's no need to use contrived workarounds to add a side_effect to a mock. Also, setting return_value actually works!
  • Python 3: Opening files as binary creates (or changes to) a BytesIO to store contents.
  • Merged the issues' unit tests to the main testing module.

Fixed

  • Issue #3: Reset file's position after open.
  • Issue #4: Consecutive with open logging as children of call() in mock_open.mock_calls (instead of just call).
  • Replaced "" strings to the more python-esque ''.