-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix: Reject keyword argument None
with .none(false)
#2611
Changes from 3 commits
77f31fc
ae32040
6f057f3
7e3cf90
e437463
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -404,6 +404,19 @@ def test_accepts_none(msg): | |
assert m.ok_none4(None) == -1 | ||
assert m.ok_none5(None) == -1 | ||
|
||
with pytest.raises(TypeError) as excinfo: | ||
m.no_none_kw(None) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also after the others, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
assert "incompatible function arguments" in str(excinfo.value) | ||
with pytest.raises(TypeError) as excinfo: | ||
m.no_none_kw(a=None) | ||
assert "incompatible function arguments" in str(excinfo.value) | ||
with pytest.raises(TypeError) as excinfo: | ||
m.no_none_kw_only(None) | ||
assert "incompatible function arguments" in str(excinfo.value) | ||
with pytest.raises(TypeError) as excinfo: | ||
m.no_none_kw_only(a=None) | ||
assert "incompatible function arguments" in str(excinfo.value) | ||
|
||
|
||
def test_str_issue(msg): | ||
"""#283: __str__ called on uninitialized instance when constructor arguments invalid""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rename is, strictly speaking, unrelated, but to increase conformity with the naming in step
// 1.
above, and to more clearly indicate the type, I renamed it.