MCPcopy Index your code
hub / github.com/python/cpython / test_aiter_bad_args

Method test_aiter_bad_args

Lib/test/test_asyncgen.py:967–981  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

965 run_test(test6)
966
967 def test_aiter_bad_args(self):
968 async def gen():
969 yield 1
970 async def call_with_too_few_args():
971 await aiter()
972 async def call_with_too_many_args():
973 await aiter(gen(), 1)
974 async def call_with_wrong_type_arg():
975 await aiter(1)
976 with self.assertRaises(TypeError):
977 self.loop.run_until_complete(call_with_too_few_args())
978 with self.assertRaises(TypeError):
979 self.loop.run_until_complete(call_with_too_many_args())
980 with self.assertRaises(TypeError):
981 self.loop.run_until_complete(call_with_wrong_type_arg())
982
983 async def to_list(self, gen):
984 res = []

Callers

nothing calls this directly

Calls 2

assertRaisesMethod · 0.45
run_until_completeMethod · 0.45

Tested by

no test coverage detected