From 518ca4a294a96dc4a88956e79b4cb4cd6bb0c30f Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Wed, 3 Apr 2024 12:27:33 +0200 Subject: tests: avoid need for a type annotation mypy wants type annotations for every def. As we only call another function, we may pass it to the decorator directly and shut up mypy. --- tests/test_simple.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/test_simple.py b/tests/test_simple.py index 8d87dae..62facf5 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -68,9 +68,7 @@ class AsnycioTest(unittest.IsolatedAsyncioTestCase): 0, linuxnamespaces.EventFDFlags.NONBLOCK ) as efd: fut = asyncio.ensure_future(efd.aread()) - @linuxnamespaces.async_run_in_fork - def set_ready(): - efd.write() + set_ready = linuxnamespaces.async_run_in_fork(efd.write) await asyncio.sleep(0.000001) # Let the loop run self.assertFalse(fut.done()) await set_ready() -- cgit v1.2.3