Uh oh!
There was an error while loading. Please reload this page.
bpo-43988: Add test.support.check_disallow_instantiation - #25757
Conversation
erlend-aasland
commented
Apr 30, 2021
cc. @vstinner |
| See bpo-43916. | ||
| """ | ||
| msg = f"cannot create '{tp.__module__}\.{tp.__name__}' instances" |
There was a problem hiding this comment.
You should use f"xxx\.xxx" or fr"xxx.xxx". Or maybe use re.escape().
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
What about setting the match pattern depending on what test.support.check_impl_detail() says?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
May 26, 2021
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. |
|
vstinner
commented
May 26, 2021
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 ( |
erlend-aasland
commented
May 26, 2021
Lets leave 3.10 as it is. |
@pablogsal, should we backport this? |
pablogsal
commented
Jun 20, 2021
I would prefer to backport it, yep |
…thonGH-25757). (cherry picked from commit 4f72526) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
https://bugs.python.org/issue43988