-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-128911: Add tests on the PyImport C API #128915
Conversation
vstinner
commented
Jan 16, 2025
•
edited
Loading
edited
- Add Modules/_testlimitedcapi/import.c
- Add Lib/test/test_capi/test_import.py
- Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests.
- Issue: [C API] Add PyImport_GetModuleAttrString(mod_name, attr_name) helper function #128911
3a83056
to
1d8342b
Compare
* Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests.
8830cc1
to
214b751
Compare
Importing
For now, I modified the tests to not import |
f027ac3
to
33b8507
Compare
I will merge my PR as it is when the CI passed, to be able to add tests in my following #128912 PR. I didn't add tests for non-UTF8 strings, nor NULL tests for @serhiy-storchaka: Maybe you would be interested to work on follow-up PR to increase the test coverage / test more cases? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you allow me to commit directly in your branch? It is better to have a single clean commit in the logs than several commits that rewrite one other.
@serhiy-storchaka: Ok, you can push changes to my branch. |
I pushed my changes. Please review them. It seems that I found bugs in the current code:
|
I pushed a cleanup changes. With this cleanup, the change (additional tests) LGTM.
Oh, interesting. |
@serhiy-storchaka: Thanks for additional tests and reviews. I enabled auto-merge. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, @vstinner, I could not cleanly backport this to
|
Sorry, @vstinner, I could not cleanly backport this to
|