Skip to content

Conversation

@millefalcon
Copy link
Contributor

@millefalcon millefalcon commented Sep 2, 2020

@ericvsmith Fixed mistake in two of the error description test for f-string/str.format.

def test_with_an_underscore_and_a_comma_in_format_specifier(self):
    error_msg = re.escape("Cannot specify both ',' and '_'.")
    with self.assertRaisesRegex(ValueError, error_msg):
        '{:,_}'.format(1)

Should have been,

def test_with_an_underscore_and_a_comma_in_format_specifier(self):
    error_msg = re.escape("Cannot specify both ',' and '_'.")
    with self.assertRaisesRegex(ValueError, error_msg):
        '{:_,}'.format(1)

And

def test_with_an_underscore_and_a_comma_in_format_specifier(self):
    error_msg = re.escape("Cannot specify both ',' and '_'.")
    with self.assertRaisesRegex(ValueError, error_msg):
        f'{1:,_}'

Should have been,

def test_with_an_underscore_and_a_comma_in_format_specifier(self):
    error_msg = re.escape("Cannot specify both ',' and '_'.")
    with self.assertRaisesRegex(ValueError, error_msg):
        f'{1:_,}'

https://bugs.python.org/issue41681

@miss-islington
Copy link
Contributor

Thanks @millefalcon for the PR, and @ericvsmith for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 2, 2020
@bedevere-bot
Copy link

GH-22060 is a backport of this pull request to the 3.9 branch.

ericvsmith pushed a commit that referenced this pull request Sep 2, 2020
…2059) (GH-22060)

(cherry picked from commit 749ed85)

Co-authored-by: han-solo <[email protected]>

Co-authored-by: han-solo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants