@@ -1415,76 +1415,77 @@ def __imatmul__(self, o):
14151415 m @= 42
14161416 self .assertEqual (m .other , 42 )
14171417
1418- def test_async_await (self ):
1419- async def test ():
1420- def sum ():
1421- pass
1422- if 1 :
1423- await someobj ()
1424-
1425- self .assertEqual (test .__name__ , 'test' )
1426- self .assertTrue (bool (test .__code__ .co_flags & inspect .CO_COROUTINE ))
1427-
1428- def decorator (func ):
1429- setattr (func , '_marked' , True )
1430- return func
1431-
1432- @decorator
1433- async def test2 ():
1434- return 22
1435- self .assertTrue (test2 ._marked )
1436- self .assertEqual (test2 .__name__ , 'test2' )
1437- self .assertTrue (bool (test2 .__code__ .co_flags & inspect .CO_COROUTINE ))
1438-
1439- def test_async_for (self ):
1440- class Done (Exception ): pass
1441-
1442- class AIter :
1443- def __aiter__ (self ):
1444- return self
1445- async def __anext__ (self ):
1446- raise StopAsyncIteration
1447-
1448- async def foo ():
1449- async for i in AIter ():
1450- pass
1451- async for i , j in AIter ():
1452- pass
1453- async for i in AIter ():
1454- pass
1455- else :
1456- pass
1457- raise Done
1458-
1459- with self .assertRaises (Done ):
1460- foo ().send (None )
1461-
1462- def test_async_with (self ):
1463- class Done (Exception ): pass
1464-
1465- class manager :
1466- async def __aenter__ (self ):
1467- return (1 , 2 )
1468- async def __aexit__ (self , * exc ):
1469- return False
1470-
1471- async def foo ():
1472- async with manager ():
1473- pass
1474- async with manager () as x :
1475- pass
1476- async with manager () as (x , y ):
1477- pass
1478- async with manager (), manager ():
1479- pass
1480- async with manager () as x , manager () as y :
1481- pass
1482- async with manager () as x , manager ():
1483- pass
1484- raise Done
1485-
1486- with self .assertRaises (Done ):
1487- foo ().send (None )
1418+ # https://github.com/IronLanguages/ironpython3/issues/1428
1419+ # def test_async_await(self):
1420+ # async def test():
1421+ # def sum():
1422+ # pass
1423+ # if 1:
1424+ # await someobj()
1425+ #
1426+ # self.assertEqual(test.__name__, 'test')
1427+ # self.assertTrue(bool(test.__code__.co_flags & inspect.CO_COROUTINE))
1428+ #
1429+ # def decorator(func):
1430+ # setattr(func, '_marked', True)
1431+ # return func
1432+ #
1433+ # @decorator
1434+ # async def test2():
1435+ # return 22
1436+ # self.assertTrue(test2._marked)
1437+ # self.assertEqual(test2.__name__, 'test2')
1438+ # self.assertTrue(bool(test2.__code__.co_flags & inspect.CO_COROUTINE))
1439+ #
1440+ # def test_async_for(self):
1441+ # class Done(Exception): pass
1442+ #
1443+ # class AIter:
1444+ # def __aiter__(self):
1445+ # return self
1446+ # async def __anext__(self):
1447+ # raise StopAsyncIteration
1448+ #
1449+ # async def foo():
1450+ # async for i in AIter():
1451+ # pass
1452+ # async for i, j in AIter():
1453+ # pass
1454+ # async for i in AIter():
1455+ # pass
1456+ # else:
1457+ # pass
1458+ # raise Done
1459+ #
1460+ # with self.assertRaises(Done):
1461+ # foo().send(None)
1462+ #
1463+ # def test_async_with(self):
1464+ # class Done(Exception): pass
1465+ #
1466+ # class manager:
1467+ # async def __aenter__(self):
1468+ # return (1, 2)
1469+ # async def __aexit__(self, *exc):
1470+ # return False
1471+ #
1472+ # async def foo():
1473+ # async with manager():
1474+ # pass
1475+ # async with manager() as x:
1476+ # pass
1477+ # async with manager() as (x, y):
1478+ # pass
1479+ # async with manager(), manager():
1480+ # pass
1481+ # async with manager() as x, manager() as y:
1482+ # pass
1483+ # async with manager() as x, manager():
1484+ # pass
1485+ # raise Done
1486+ #
1487+ # with self.assertRaises(Done):
1488+ # foo().send(None)
14881489
14891490
14901491if __name__ == '__main__' :
0 commit comments