File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -3209,12 +3209,14 @@ def _shutdown_connections(
3209
3209
) -> None :
3210
3210
"""Helper to safely shut down SSL connections and close sockets."""
3211
3211
logger .debug ("--- Cleanup: Shutting down connections ---" )
3212
- try :
3213
- if client :
3212
+ if client :
3213
+ with contextlib .suppress (OpenSSL .SSL .Error ):
3214
+ # When closing connections in the test teardown stage, we don't care
3215
+ # about possible TLS-level problems as the test was specifically
3216
+ # emulating corner case situations pre-shutdown. We just attempt
3217
+ # releasing resources if possible and disregard any possibly related
3218
+ # problems that may occur at this point.
3214
3219
client .shutdown ()
3215
- except Exception :
3216
- # An exception is usually thrown so it is caught and ignored.
3217
- pass
3218
3220
try :
3219
3221
if server :
3220
3222
server .shutdown ()
You can’t perform that action at this time.
0 commit comments