Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-43478: Restrict use of Mock objects as specs #31090

Merged
merged 1 commit into from
Feb 3, 2022

Conversation

msuozzo
Copy link
Contributor

@msuozzo msuozzo commented Feb 2, 2022

@msuozzo
Copy link
Contributor Author

msuozzo commented Feb 2, 2022

@gpshead

@msuozzo msuozzo force-pushed the patch-3 branch 2 times, most recently from 9b78450 to 12a86e5 Compare February 3, 2022 00:22
@gpshead
Copy link
Member

gpshead commented Feb 3, 2022

When doing our internal codebase cleanups for this, how many issues did you uncover in third party open source projects? Were they turned into PRs? If so, noting that in the bug with links to some would be good.

Otherwise if there were a meaningful number of those, I wonder if we shouldn't make this issue a warning for 3.11 and turn it into this error for 3.12. (The thing we're aiming to prevent is an inability to test major Python packages on 3.11 alphas and betas.) Going ahead with this as is probably makes sense. But if it blocks testing while upstream projects fix things, we should probably turn it into a warning for one release while Issues/PRs elsewhere get filed.

@gpshead
Copy link
Member

gpshead commented Feb 3, 2022

Can you also add an entry to the 3.11 What's New doc? More people read that than the detailed NEWS.

@gpshead gpshead added type-bug An unexpected behavior, bug, or error type-feature A feature request or enhancement labels Feb 3, 2022
@gpshead gpshead added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 3, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @gpshead for commit 12a86e5f83958cfe6d1bf6a018c6a8733454101d 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 3, 2022
@msuozzo
Copy link
Contributor Author

msuozzo commented Feb 3, 2022

When doing our internal codebase cleanups for this, how many issues did you uncover in third party open source projects? Were they turned into PRs? If so, noting that in the bug with links to some would be good.

This last cleanup only had one true python hit: forseti-security/forseti-security#3875

The previous PR hit tensorflow, google-research, ocp-diag-core and a few other third-party repos but I don't have the associated PRs handy.

Otherwise if there were a meaningful number of those, I wonder if we shouldn't make this issue a warning for 3.11 and turn it into this error for 3.12. (The thing we're aiming to prevent is an inability to test major Python packages on 3.11 alphas and betas.) Going ahead with this as is probably makes sense. But if it blocks testing while upstream projects fix things, we should probably turn it into a warning for one release while Issues/PRs elsewhere get filed.

The more expansive version of this check shipped in 3.10 with this edge case not in it. I think this is a lot less likely that this addition trips people up and breaks tests so I'm inclined to leave it in as-is.

Can you also add an entry to the 3.11 What's New doc? More people read that than the detailed NEWS.

I will if you think it's worth it. Again, I think the part of this that shipped in 3.10 was more likely to break people.

@gpshead
Copy link
Member

gpshead commented Feb 3, 2022

Alright, looking things over given the history I don't think we needs a What's New entry just for this. It seems pretty low surprise and doesn't appear to have a wide blast radius of lurking problem exposure.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Follow-on to python#25326

This covers cases where mock objects are passed directly to spec.
@gpshead gpshead merged commit 6394e98 into python:main Feb 3, 2022
@cjw296
Copy link
Contributor

cjw296 commented Feb 3, 2022

Tangentially, @msuozzo: the "temporary" skip you introduced in #25326 is now almost a year old...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants