FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-43988: Add test.support.check_disallow_instantiation by erlend-aasland · Pull Request #25757 · python/cpython · GitHub

/ cpython Public

bpo-43988: Add test.support.check_disallow_instantiation - #25757

Merged
vstinner merged 1 commit into
python:mainfrom
erlend-aasland:test-support
May 26, 2021
Merged

bpo-43988: Add test.support.check_disallow_instantiation#25757
vstinner merged 1 commit into
python:mainfrom
erlend-aasland:test-support

Conversation

erlend-aasland commented Apr 30, 2021
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor Author

cc. @vstinner


See bpo-43916.
"""
msg = f"cannot create '{tp.__module__}\.{tp.__name__}' instances"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You should use f"xxx\.xxx" or fr"xxx.xxx". Or maybe use re.escape().

erlend-aasland May 2, 2021
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Since these tests are decorated with cpython_only, it should be ok to match the exact string, as produced by Objects/typeobject.c? Just matching the type module/name could in theory generate wrong result; maybe not in practice though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What about setting the match pattern depending on what test.support.check_impl_detail() says?

vstinner merged commit 4f72526 into python:main May 26, 2021

Copy link
Copy Markdown
Member

Enough nitpicking, you can always enhance the code later ;-) I merged your PR, thanks. I guess that the next step is to modify existing tests to use it.

erlend-aasland commented May 26, 2021
edited
Loading

Copy link
Copy Markdown
Contributor Author

Backport to 3.10? I guess not.

Copy link
Copy Markdown
Member

Backport to 3.10? I guess not.

It seems like more changes are coming. Once they all landed into main, maybe write a backport to 3.10 PR including all of them at once (git cherry-pick -x all commits in the right order). Or we can leave 3.10 as it is: it's more up to you.

Copy link
Copy Markdown
Contributor Author

Lets leave 3.10 as it is.

erlend-aasland commented Jun 20, 2021
edited
Loading

Copy link
Copy Markdown
Contributor Author

@pablogsal, should we backport this? grep -r disallow_insta Lib/test | wc -l gives me 14 hits on the 3.10 branch, including the recently backported sqlite3 test.

Copy link
Copy Markdown
Member

@pablogsal, should we backport this? grep -r disallow_insta Lib/test | wc -l gives me 14 hits on the 3.10 branch, including the recently backported sqlite3 test.

I would prefer to backport it, yep

erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this pull request Jun 23, 2021
…thonGH-25757).

(cherry picked from commit 4f72526)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Copy link
Copy Markdown
Contributor Author

Once they all landed into main, maybe write a backport to 3.10 PR including all of them at once (git cherry-pick -x all commits in the right order)

@vstinner: I've opened GH-26885 which is a backport of this PR, GH-26394 (docs for this PR), and GH-26392 (apply this PR to Lib/test).

miss-islington pushed a commit that referenced this pull request Jun 23, 2021
…-25757) (GH-26885)

(cherry picked from commit 4f72526, fbff538, and 8cec740)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Automerge-Triggered-By: GH:vstinner
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL