Skip to content

gh-151335: Add test for string with digits and whitespaces in test_isdigit()#151334

Closed
manoj-marimuthu wants to merge 1 commit into
python:mainfrom
manoj-marimuthu:increase-test-coverage-for-is-digit
Closed

gh-151335: Add test for string with digits and whitespaces in test_isdigit()#151334
manoj-marimuthu wants to merge 1 commit into
python:mainfrom
manoj-marimuthu:increase-test-coverage-for-is-digit

Conversation

@manoj-marimuthu

@manoj-marimuthu manoj-marimuthu commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The following PR adds a test case for test_isdigit() in Lib/test/string_tests.py to test strings with only digits and whitespaces.

self.checkequal(False, '123 ', 'isdigit')

@manoj-marimuthu manoj-marimuthu changed the title Add test for string with digits and whitespaces in test_isdigit() gh-151335: Add test for string with digits and whitespaces in test_isdigit() Jun 11, 2026

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds no new coverage, there is nothing special about whitespace:

cpython/Objects/unicodeobject.c

Lines 12054 to 12057 in 8c0e251

for (i = 0; i < length; i++) {
if (!Py_UNICODE_ISDIGIT(PyUnicode_READ(kind, data, i)))
Py_RETURN_FALSE;
}

I see you have submitted several such PRs that add a single assert, I suggest you try fixing one of the open issues instead.

@bedevere-app

bedevere-app Bot commented Jun 11, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

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.

2 participants