Skip to content

Commit 0596416

Browse files
committed
test create_autospec with inspect.iscoroutine and inspect.iscoroutinefunction
1 parent 1a39312 commit 0596416

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_unittest/testmock/testasync.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ async def main():
219219
run(main())
220220

221221
self.assertTrue(iscoroutinefunction(spec))
222+
self.assertTrue(inspect.iscoroutinefunction(spec))
222223
self.assertTrue(asyncio.iscoroutine(awaitable))
224+
self.assertTrue(inspect.iscoroutine(awaitable))
223225
self.assertEqual(spec.await_count, 1)
224226
self.assertEqual(spec.await_args, call(1, 2, c=3))
225227
self.assertEqual(spec.await_args_list, [call(1, 2, c=3)])
@@ -240,7 +242,9 @@ async def test_async():
240242
self.assertIsInstance(mock_method.mock, AsyncMock)
241243

242244
self.assertTrue(iscoroutinefunction(mock_method))
245+
self.assertTrue(inspect.iscoroutinefunction(mock_method))
243246
self.assertTrue(asyncio.iscoroutine(awaitable))
247+
self.assertTrue(inspect.iscoroutine(awaitable))
244248
self.assertTrue(inspect.isawaitable(awaitable))
245249

246250
# Verify the default values during mock setup

0 commit comments

Comments
 (0)