Skip to content

Add more tests for zero-sized bytes objects in capi tests #131357

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

Closed
sobolevn opened this issue Mar 17, 2025 · 6 comments
Closed

Add more tests for zero-sized bytes objects in capi tests #131357

sobolevn opened this issue Mar 17, 2025 · 6 comments
Assignees
Labels
easy tests Tests in the Lib/test dir topic-C-API type-bug An unexpected behavior, bug, or error

Comments

@sobolevn sobolevn added easy tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Mar 17, 2025
@CHB-0r1s
Copy link

Can I work on this?

@sobolevn
Copy link
Member Author

@CHB-0r1s sure, please go ahead! ❤

@picnixz picnixz marked this as a duplicate of #131552 Mar 22, 2025
sobolevn pushed a commit that referenced this issue Mar 23, 2025
…1554)

add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 23, 2025
pythonGH-131554)

add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.
(cherry picked from commit f3bf304)

Co-authored-by: Nybblista <[email protected]>
sobolevn pushed a commit that referenced this issue Mar 23, 2025
…ay (GH-131554) (#131601)

gh-131357: Add a set of asserts to test.test_capi.test_bytearray (GH-131554)

add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.
(cherry picked from commit f3bf304)

Co-authored-by: Nybblista <[email protected]>
sobolevn pushed a commit that referenced this issue Mar 23, 2025
…ay (GH-131554) (#131629)

[3.12] gh-131357: Add a set of asserts to test.test_capi.test_bytearray (#131554)

add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.

(cherry picked from commit f3bf304)
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
python#131554)

add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.
@AlexKautz
Copy link
Contributor

Looks ready to close

@gpshead
Copy link
Member

gpshead commented May 20, 2025

@vstinner / @sobolevn is this an "ongoing more PRs to be made" issue or ready to close with the recently merged PRs?

miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 20, 2025
….py (pythonGH-134234)

(cherry picked from commit 306f9e0)

Co-authored-by: abstractedfox <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 20, 2025
….py (pythonGH-134234)

(cherry picked from commit 306f9e0)

Co-authored-by: abstractedfox <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
@vstinner
Copy link
Member

For instance PyBytes_FromObject(b'') is not tested.

Oh. It is still not tested. Does someone want to propose a PR for that?

vstinner added a commit that referenced this issue May 20, 2025
…s.py (GH-134234) (#134379)

gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (GH-134234)
(cherry picked from commit 306f9e0)

Co-authored-by: abstractedfox <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
vstinner added a commit that referenced this issue May 20, 2025
…s.py (GH-134234) (#134378)

gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (GH-134234)
(cherry picked from commit 306f9e0)

Co-authored-by: abstractedfox <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
@sergey-miryanov
Copy link
Contributor

@vstinner Please take a look - #134458

sergey-miryanov added a commit to sergey-miryanov/cpython that referenced this issue May 22, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 22, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 22, 2025
vstinner pushed a commit that referenced this issue May 22, 2025
…H-134458) (#134490)

gh-131357: Add some extra tests for empty bytes and bytearray (GH-134458)
(cherry picked from commit 7309eb6)

Co-authored-by: Sergey Miryanov <[email protected]>
vstinner pushed a commit that referenced this issue May 22, 2025
…H-134458) (#134489)

gh-131357: Add some extra tests for empty bytes and bytearray (GH-134458)
(cherry picked from commit 7309eb6)

Co-authored-by: Sergey Miryanov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy tests Tests in the Lib/test dir topic-C-API type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

6 participants