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
| 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.
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.
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.
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.
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
No description provided.