From ab422f7ec02a55c93b620670c415e76279247192 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 15 Nov 2022 09:06:56 +0100 Subject: [PATCH] Make first case pass setting code flags. --- Lib/test/test_inspect.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 6058c57d8ba7402..ab7838bf927a5ab 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -210,6 +210,12 @@ async def _fn3(): def fn3(): return _fn3() + + # TODO: Move this to decorator function. + fn3.__code__ = fn3.__code__.replace( + co_flags=fn3.__code__.co_flags | inspect.CO_COROUTINE + ) + self.assertTrue(inspect.iscoroutinefunction(fn3)) with self.subTest("Awaitable instance not recongnised."):