bpo-33967: Remove use of deprecated assertRaisesRegexp() by ZackerySpytz · Pull Request #8261 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation7 Commits3 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

ZackerySpytz

@ZackerySpytz

@methane

@methane methane changed the titlebpo-33967: Fix use of deprecated assertRaisesRegexp() in test_functools bpo-33967: Remove use of deprecated assertRaisesRegexp()

Jul 12, 2018

@ZackerySpytz

CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request

Jul 14, 2018

@CuriousLearner

CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request

Jul 15, 2018

@CuriousLearner

@miss-islington

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

@miss-islington

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

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jul 16, 2018

@ZackerySpytz @miss-islington

It was added in test_functools at 445f1b3. (cherry picked from commit 9e9b2c3)

Co-authored-by: Zackery Spytz zspytz@gmail.com

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jul 16, 2018

@ZackerySpytz @miss-islington

It was added in test_functools at 445f1b3. (cherry picked from commit 9e9b2c3)

Co-authored-by: Zackery Spytz zspytz@gmail.com

vstinner pushed a commit that referenced this pull request

Jul 16, 2018

…H-8295)

It was added in test_functools at 445f1b3. (cherry picked from commit 9e9b2c3)

Co-authored-by: Zackery Spytz zspytz@gmail.com

vstinner pushed a commit that referenced this pull request

Jul 16, 2018

…H-8296)

It was added in test_functools at 445f1b3. (cherry picked from commit 9e9b2c3)

Co-authored-by: Zackery Spytz zspytz@gmail.com

serhiy-storchaka

@@ -2310,7 +2310,7 @@ def test_invalid_positional_argument(self):
def f(*args):
pass
msg = 'f requires at least 1 positional argument'
with self.assertRaisesRegexp(TypeError, msg):
with self.assertRaises(TypeError, msg=msg):

Choose a reason for hiding this comment

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

This is not correct use of msg. The correct code is:

with self.assertRaisesRegex(TypeError, msg):

The msg argument of assertRaises() is used for reporting a failure. But it should be used for testing the error message.

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

I'm sorry. It was my mistake.

CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request

Jul 21, 2018

@CuriousLearner

…ssue-33014