-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
configure filterwarnings=error #2790
Conversation
4820a91
to
e959487
Compare
We have this mysterious coverage issue which does not make any sense to me:
|
0d03ce2
to
c5f1a53
Compare
@pquentin ok I fixed that weird coverage issue by rebasing on your pyproject.toml pytest config |
13525bb
to
7e381a2
Compare
43a1a4b
to
a3dc458
Compare
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.
Thanks, excellent work!
try: | ||
with self.server_context.wrap_socket(sock, server_side=True) as ssock: | ||
request = consume_socket(ssock) | ||
validate_request(request) | ||
ssock.send(sample_response()) | ||
except (ConnectionAbortedError, ConnectionResetError): | ||
return |
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.
Should we use contextlib.suppress
here and below?
Also, in what context is it useful? It's not intuitive that this could raise an exception and not actually start the server
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.
You don't use contextlib.suppress
anywhere else and I find it to be confusing compared to the regular try/catch
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.
OK, but in what context is it useful? It's not intuitive that this could raise an exception and not actually start the server
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.
previously it was as if there was a try: .... except BaseException: return
there, this is actually just limiting the exceptions to just those. This is because effectively all exceptions in a thread are ignored by default and the filterwarings=error collects those exceptions so we need to do something about the ones that do happen
rather than add PytestUnhandledThreadExceptionWarning to the filterwarnings, as a TODO, I think it's better to do the narrower workaround here
warnings.WarningMessage has a default repr and so shows up as: Left contains one more item: <warnings.WarningMessage object at 0x0000000005d234b0> Full diff: - [] + [<warnings.WarningMessage object at 0x0000000005d234b0>]
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
01115cd
to
23eeb08
Compare
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.
only one question left!
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.
Thanks! LGTM.
No description provided.