Mock-open

Latest version: v1.4.0

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.3.2

Changed
- Added TravisCI integration.

Fixed
- Issue 7: Side effect now returns `unittest.mock.DEFAULT`.
- Fixed compatibility issue with `AsyncMock` changes in 3.8.

1.3.1

Fixed
- Issue 5: Uploaded a new version to PyPi, identical to 1.3.0 functionality-wise.

1.3.0

Update

Submitted as a [patch](https://bugs.python.org/issue25690) 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 `''`.

1.2.2

Fixed
- Issues: 2.

1.2.1

Fixed
- Issues: 1.

1.2.0

Changed
- Use the standard `unittest.mock` library in python 3.3+ and the [backport](https://pypi.python.org/pypi/mock/) in earlier versions.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.