cpython/Lib/unittest
Miss Islington (bot) 43f71b0005
[3.13] gh-150175: Fix ThreadingMock call_count race condition (GH-150176) (#150180)
gh-150175: Fix ThreadingMock call_count race condition (GH-150176)

ThreadingMock._increment_mock_call() was not thread-safe.
Multiple threads calling the mock simultaneously could lose
increments due to race conditions on call_count and other
attributes.

Fix by overriding _increment_mock_call in ThreadingMixin
and wrapping it with the existing _mock_calls_events_lock.
(cherry picked from commit 388e023fe1)

Co-authored-by: saisneha196 <156835592+saisneha196@users.noreply.github.com>
2026-05-26 12:47:20 -07:00
..
__init__.py
__main__.py
_log.py
async_case.py
case.py
loader.py
main.py
mock.py [3.13] gh-150175: Fix ThreadingMock call_count race condition (GH-150176) (#150180) 2026-05-26 12:47:20 -07:00
result.py
runner.py
signals.py
suite.py
util.py