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

gh-94808: Cover PyObject_PyBytes case with custom __bytes__ method #96610

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Sep 6, 2022

There were two options:

  1. Add a new _testcapimodule.c function to test PyObject_PyBytes directly. But, there's already pyobject_bytes_from_null which only covers NULL case. So, it is somewhat covered
  2. Add a test for some call that uses PyObject_Bytes, like int_from_bytes_impl. In this case we not only test C-API itself, but also do something useful for the end implementation (in this case int.from_bytes)

So, I went with 2.
Probably it is still possible to add a new _testcapimodule.c function in the next PR.

@bedevere-bot bedevere-bot added awaiting review tests Tests in the Lib/test dir labels Sep 6, 2022
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.

None yet

3 participants