You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.13 introduces a behavior change in unittest.mock.mock_open(),
which now calls close() when exiting the context manager
as described in bpo-44185 [1]. This causes additional mock calls to appear,
breaking strict mock_calls assertions.
This patch fix tests and add compatibility for Python 3.13.
From mock documentation [2]:
"bpo-44185: unittest.mock.mock_open() will call the close() method
of the file handle mock when it is exiting from the context manager.
Patch by Samet Yaslan."
[1] https://bugs.python.org/issue44185
[2] https://mock.readthedocs.io/en/latest/changelog.html
Change-Id: Ib8e2a8a20a828c4c69deedd307c9b726f51489f8
0 commit comments