[3.11] gh-98624 Add mutex to unittest.mock.NonCallableMock (GH-98688)#98797
Merged
ambv merged 1 commit intopython:3.11from Oct 28, 2022
Merged
[3.11] gh-98624 Add mutex to unittest.mock.NonCallableMock (GH-98688)#98797ambv merged 1 commit intopython:3.11from
ambv merged 1 commit intopython:3.11from
Conversation
…8688) * Added lock to NonCallableMock in unittest.mock * Add blurb * Nitpick blurb * Edit comment based on @Jason-Y-Z's review * Add link to GH issue (cherry picked from commit 0346edd) Co-authored-by: noah-weingarden <33741795+noah-weingarden@users.noreply.github.com>
dtantsur
reviewed
Jan 10, 2023
| # | ||
| # See https://github.com/python/cpython/issues/98624 for why this is | ||
| # necessary. | ||
| _lock = RLock() |
There was a problem hiding this comment.
@ambv could that be renamed? this change broke us since we no longer get an implicit our_object._lock mock... Can be worked around, but potentially affect a lot of people, and the workaround will undo your fix.
openstack-mirroring
pushed a commit
to openstack/openstack
that referenced
this pull request
Jan 27, 2023
* Update ironic-inspector from branch 'master'
to d65d6020c25e25e00b5b9f85fe97731fb8a56e3f
- Merge "Rename NodeInfo._lock to avoid conflict with Mock._lock in tests"
- Rename NodeInfo._lock to avoid conflict with Mock._lock in tests
Starting with python/cpython#98797, Python's
Mock has its own _lock. I hope they rename it to something really
private (e.g. __lock), but for now rename our attribute (and hope that
no downstream plugins relied on it, sigh).
Change-Id: I7ba858fb3f259b8e7a3becde94b7ba6b90615287
openstack-mirroring
pushed a commit
to openstack/ironic-inspector
that referenced
this pull request
Jan 27, 2023
Starting with python/cpython#98797, Python's Mock has its own _lock. I hope they rename it to something really private (e.g. __lock), but for now rename our attribute (and hope that no downstream plugins relied on it, sigh). Change-Id: I7ba858fb3f259b8e7a3becde94b7ba6b90615287
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added lock to NonCallableMock in unittest.mock
Add blurb
Nitpick blurb
Edit comment based on @Jason-Y-Z's review
Add link to GH issue
(cherry picked from commit 0346edd)
Co-authored-by: noah-weingarden 33741795+noah-weingarden@users.noreply.github.com
unittest.mock#98624