Skip to content

gh-151162: Increase test coverage for string formatting#151161

Open
manoj-marimuthu wants to merge 1 commit into
python:mainfrom
manoj-marimuthu:add-tests-str
Open

gh-151162: Increase test coverage for string formatting#151161
manoj-marimuthu wants to merge 1 commit into
python:mainfrom
manoj-marimuthu:add-tests-str

Conversation

@manoj-marimuthu

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

Copy link
Copy Markdown
Contributor

In Lib/test/test_str.py, string formatting is tested for nan and inf but not for -inf. -inf could be the most important among them (since we have to check if '-' formats correctly). The following PR adds 2 test cases for -inf with %f and %F.

Existing:

self.assertEqual('%f' % NAN, 'nan')
self.assertEqual('%F' % NAN, 'NAN')
self.assertEqual('%f' % INF, 'inf')
self.assertEqual('%F' % INF, 'INF')

Added:

self.assertEqual('%f' % -INF, '-inf')
self.assertEqual('%F' % -INF, '-INF')

@bedevere-app bedevere-app Bot added awaiting review tests Tests in the Lib/test dir labels Jun 9, 2026
@manoj-marimuthu manoj-marimuthu changed the title Increase test coverage for string formatting gh-151162 :Increase test coverage for string formatting Jun 9, 2026
@skirpichev skirpichev changed the title gh-151162 :Increase test coverage for string formatting gh-151162: Increase test coverage for string formatting Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants