@@ -472,31 +472,29 @@ async def test_ssl_client_basics(client_ctx: SSLContext) -> None:
472472 # rather than choking with UNEXPECTED_EOF_WHILE_READING.
473473 with pytest .RaisesGroup (
474474 pytest .RaisesExc (ssl .SSLError , match = "TLSV1_ALERT_UNKNOWN_CA" )
475- ) as excinfo :
475+ ):
476476 async with ssl_echo_server_raw (expect_fail = "raise" ) as sock :
477477 bad_client_ctx = ssl .create_default_context ()
478478 s = SSLStream (
479479 sock , bad_client_ctx , server_hostname = "trio-test-1.example.org"
480480 )
481481 assert not s .server_side
482- with pytest .RaisesGroup (
483- BrokenResourceError , allow_unwrapped = True , flatten_subgroups = True
484- ) as excinfo :
482+ with pytest .raises (BrokenResourceError ) as excinfo1 :
485483 await s .send_all (b"x" )
486- assert isinstance (excinfo .value .__cause__ , ssl .SSLError )
484+ assert isinstance (excinfo1 .value .__cause__ , ssl .SSLError )
487485
488486 # Trusted CA, but wrong host name
489487 # Check that the server receives SSLV3_ALERT_BAD_CERTIFICATE
490488 # rather than choking with UNEXPECTED_EOF_WHILE_READING.
491489 with pytest .RaisesGroup (
492490 pytest .RaisesExc (ssl .SSLError , match = "SSLV3_ALERT_BAD_CERTIFICATE" )
493- ) as excinfo :
491+ ):
494492 async with ssl_echo_server_raw (expect_fail = "raise" ) as sock :
495493 s = SSLStream (sock , client_ctx , server_hostname = "trio-test-2.example.org" )
496494 assert not s .server_side
497- with pytest .raises (BrokenResourceError ) as excinfo :
495+ with pytest .raises (BrokenResourceError ) as excinfo2 :
498496 await s .send_all (b"x" )
499- assert isinstance (excinfo .value .__cause__ , ssl .CertificateError )
497+ assert isinstance (excinfo2 .value .__cause__ , ssl .CertificateError )
500498
501499
502500async def test_ssl_server_basics (client_ctx : SSLContext ) -> None :
0 commit comments