@@ -233,6 +233,7 @@ async def start_server():
233
233
return await serve (handler , "localhost" , 0 , ** kwargs )
234
234
235
235
with warnings .catch_warnings (record = True ) as recorded_warnings :
236
+ warnings .simplefilter ("always" )
236
237
self .server = self .loop .run_until_complete (start_server ())
237
238
238
239
expected_warnings = [] if deprecation_warnings is None else deprecation_warnings
@@ -259,6 +260,7 @@ async def start_client():
259
260
return await connect (server_uri , ** kwargs )
260
261
261
262
with warnings .catch_warnings (record = True ) as recorded_warnings :
263
+ warnings .simplefilter ("always" )
262
264
self .client = self .loop .run_until_complete (start_client ())
263
265
264
266
expected_warnings = [] if deprecation_warnings is None else deprecation_warnings
@@ -536,6 +538,7 @@ def legacy_process_request_OK(path, request_headers):
536
538
@with_server (process_request = legacy_process_request_OK )
537
539
def test_process_request_argument_backwards_compatibility (self ):
538
540
with warnings .catch_warnings (record = True ) as recorded_warnings :
541
+ warnings .simplefilter ("always" )
539
542
response = self .loop .run_until_complete (self .make_http_request ("/" ))
540
543
541
544
with contextlib .closing (response ):
@@ -563,6 +566,7 @@ def process_request(self, path, request_headers):
563
566
@with_server (create_protocol = LegacyProcessRequestOKServerProtocol )
564
567
def test_process_request_override_backwards_compatibility (self ):
565
568
with warnings .catch_warnings (record = True ) as recorded_warnings :
569
+ warnings .simplefilter ("always" )
566
570
response = self .loop .run_until_complete (self .make_http_request ("/" ))
567
571
568
572
with contextlib .closing (response ):
@@ -607,6 +611,7 @@ def test_protocol_deprecated_attributes(self):
607
611
for server_socket in self .server .sockets
608
612
]
609
613
with warnings .catch_warnings (record = True ) as recorded_warnings :
614
+ warnings .simplefilter ("always" )
610
615
client_attrs = (self .client .host , self .client .port , self .client .secure )
611
616
self .assertDeprecationWarnings (
612
617
recorded_warnings ,
@@ -620,6 +625,7 @@ def test_protocol_deprecated_attributes(self):
620
625
621
626
expected_server_attrs = ("localhost" , 0 , self .secure )
622
627
with warnings .catch_warnings (record = True ) as recorded_warnings :
628
+ warnings .simplefilter ("always" )
623
629
self .loop .run_until_complete (self .client .send ("" ))
624
630
server_attrs = self .loop .run_until_complete (self .client .recv ())
625
631
self .assertDeprecationWarnings (
@@ -1356,7 +1362,8 @@ class YieldFromTests(ClientServerTestsMixin, AsyncioTestCase):
1356
1362
@with_server ()
1357
1363
def test_client (self ):
1358
1364
# @asyncio.coroutine is deprecated on Python ≥ 3.8
1359
- with warnings .catch_warnings (record = True ):
1365
+ with warnings .catch_warnings ():
1366
+ warnings .simplefilter ("ignore" )
1360
1367
1361
1368
@asyncio .coroutine
1362
1369
def run_client ():
@@ -1370,7 +1377,8 @@ def run_client():
1370
1377
1371
1378
def test_server (self ):
1372
1379
# @asyncio.coroutine is deprecated on Python ≥ 3.8
1373
- with warnings .catch_warnings (record = True ):
1380
+ with warnings .catch_warnings ():
1381
+ warnings .simplefilter ("ignore" )
1374
1382
1375
1383
@asyncio .coroutine
1376
1384
def run_server ():
0 commit comments