Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3348: raise error on unknown arguments to raises #3349

Merged

Conversation

jeffreyrack
Copy link
Member

Per #3348, I've gone ahead and updated pytest.raises to raise a TypeError if an invalid keyword argument is passed.

In addition, I fixed an issue of a test case in pytest that was passing an invalid keyword argument to pytest.raises.

@coveralls
Copy link

coveralls commented Mar 28, 2018

Coverage Status

Coverage increased (+0.06%) to 92.857% when pulling 7656581 on jeffreyrack:3348-unknown-argument into ff3d13e on pytest-dev:master.

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

fabulous execution and nice find 👍

since you use pop, please use if kwargs as the condition as that sufficient for boolean context

@RonnyPfannschmidt RonnyPfannschmidt changed the title 3348: unknown argument 3348: raise error on unknown arguments to raises Mar 28, 2018
@The-Compiler
Copy link
Member

Really looking forward to dropping Python 2 support so we don't have to do kwargs handling by hand 😉

@nicoddemus
Copy link
Member

Thanks @jeffreyrack!

Done @RonnyPfannschmidt's suggestion of using if kwargs and updated CHANGELOG slightly (did I ever say I love being able to edit files directly in GH's interface? 😉)

Really looking forward to dropping Python 2 support so we don't have to do kwargs handling by hand

Definitely! Perhaps next year with 4.0? 🤞

@RonnyPfannschmidt RonnyPfannschmidt merged commit 2efaf39 into pytest-dev:master Mar 28, 2018
@jeffreyrack jeffreyrack deleted the 3348-unknown-argument branch March 30, 2018 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants