@@ -1398,7 +1398,7 @@ async def __anext__(self):
13981398
13991399 buffer = []
14001400 async def test1 ():
1401- with self .assertWarnsRegex (PendingDeprecationWarning , "legacy" ):
1401+ with self .assertWarnsRegex (DeprecationWarning , "legacy" ):
14021402 async for i1 , i2 in AsyncIter ():
14031403 buffer .append (i1 + i2 )
14041404
@@ -1412,7 +1412,7 @@ async def test1():
14121412 buffer = []
14131413 async def test2 ():
14141414 nonlocal buffer
1415- with self .assertWarnsRegex (PendingDeprecationWarning , "legacy" ):
1415+ with self .assertWarnsRegex (DeprecationWarning , "legacy" ):
14161416 async for i in AsyncIter ():
14171417 buffer .append (i [0 ])
14181418 if i [0 ] == 20 :
@@ -1431,7 +1431,7 @@ async def test2():
14311431 buffer = []
14321432 async def test3 ():
14331433 nonlocal buffer
1434- with self .assertWarnsRegex (PendingDeprecationWarning , "legacy" ):
1434+ with self .assertWarnsRegex (DeprecationWarning , "legacy" ):
14351435 async for i in AsyncIter ():
14361436 if i [0 ] > 20 :
14371437 continue
@@ -1514,7 +1514,7 @@ def __anext__(self):
15141514 return 123
15151515
15161516 async def foo ():
1517- with self .assertWarnsRegex (PendingDeprecationWarning , "legacy" ):
1517+ with self .assertWarnsRegex (DeprecationWarning , "legacy" ):
15181518 async for i in I ():
15191519 print ('never going to happen' )
15201520
@@ -1623,7 +1623,7 @@ async def __aiter__(self):
16231623 1 / 0
16241624 async def foo ():
16251625 nonlocal CNT
1626- with self .assertWarnsRegex (PendingDeprecationWarning , "legacy" ):
1626+ with self .assertWarnsRegex (DeprecationWarning , "legacy" ):
16271627 async for i in AI ():
16281628 CNT += 1
16291629 CNT += 10
@@ -1650,7 +1650,7 @@ async def foo():
16501650 self .assertEqual (CNT , 0 )
16511651
16521652 def test_for_9 (self ):
1653- # Test that PendingDeprecationWarning can safely be converted into
1653+ # Test that DeprecationWarning can safely be converted into
16541654 # an exception (__aiter__ should not have a chance to raise
16551655 # a ZeroDivisionError.)
16561656 class AI :
@@ -1660,13 +1660,13 @@ async def foo():
16601660 async for i in AI ():
16611661 pass
16621662
1663- with self .assertRaises (PendingDeprecationWarning ):
1663+ with self .assertRaises (DeprecationWarning ):
16641664 with warnings .catch_warnings ():
16651665 warnings .simplefilter ("error" )
16661666 run_async (foo ())
16671667
16681668 def test_for_10 (self ):
1669- # Test that PendingDeprecationWarning can safely be converted into
1669+ # Test that DeprecationWarning can safely be converted into
16701670 # an exception.
16711671 class AI :
16721672 async def __aiter__ (self ):
@@ -1675,7 +1675,7 @@ async def foo():
16751675 async for i in AI ():
16761676 pass
16771677
1678- with self .assertRaises (PendingDeprecationWarning ):
1678+ with self .assertRaises (DeprecationWarning ):
16791679 with warnings .catch_warnings ():
16801680 warnings .simplefilter ("error" )
16811681 run_async (foo ())
0 commit comments