| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -40,6 +40,7 @@ | |
| "requires_IEEE_754", "requires_zlib", | ||
| "anticipate_failure", "load_package_tests", "detect_api_mismatch", | ||
| "check__all__", "skip_if_buggy_ucrt_strfptime", | ||
| "check_disallow_instantiation", | ||
| # sys | ||
| "is_jython", "is_android", "check_impl_detail", "unix_shell", | ||
| "setswitchinterval", | ||
| Expand Down Expand Up | @@ -1982,3 +1983,13 @@ def skip_if_broken_multiprocessing_synchronize(): | |
| synchronize.Lock(ctx=None) | ||
| except OSError as exc: | ||
| raise unittest.SkipTest(f"broken multiprocessing SemLock: {exc!r}") | ||
|
|
||
|
|
||
| def check_disallow_instantiation(testcase, tp, *args, **kwds): | ||
|
Comment thread
erlend-aasland marked this conversation as resolved.
|
||
| """ | ||
| Helper for testing types with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag. | ||
|
Comment thread
erlend-aasland marked this conversation as resolved.
|
||
|
|
||
| See bpo-43916. | ||
| """ | ||
| msg = f"cannot create '{tp.__module__}\.{tp.__name__}' instances" | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityYou should use f"xxx\.xxx" or fr"xxx.xxx". Or maybe use re.escape().
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualitySince 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.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWhat about setting the match pattern depending on what test.support.check_impl_detail() says?
Sorry, something went wrong.
All reactions
|
||
| testcase.assertRaisesRegex(TypeError, msg, tp, *args, **kwds) | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.