Skip to content

bpo-41681 Fixed mistake in test for f-string/str.format error description (GH-22036)#22059

Merged
ericvsmith merged 1 commit into
python:masterfrom
millefalcon:fix/error_test
Sep 2, 2020
Merged

bpo-41681 Fixed mistake in test for f-string/str.format error description (GH-22036)#22059
ericvsmith merged 1 commit into
python:masterfrom
millefalcon:fix/error_test

Conversation

@millefalcon
Copy link
Copy Markdown
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
Copy Markdown
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
…pythonGH-22059)

(cherry picked from commit 749ed85)

Co-authored-by: han-solo <hanish0019@gmail.com>
@bedevere-bot
Copy link
Copy Markdown

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 <hanish0019@gmail.com>

Co-authored-by: han-solo <hanish0019@gmail.com>
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