summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-04-03 12:27:33 +0200
committerHelmut Grohne <helmut@subdivi.de>2024-04-03 12:27:33 +0200
commit518ca4a294a96dc4a88956e79b4cb4cd6bb0c30f (patch)
treedb7c436d46a55803cd5da1d53c48d1566113a6ed /tests
parentbd4edf4167923e83242933cb86402906243fcbe0 (diff)
downloadpython-linuxnamespaces-518ca4a294a96dc4a88956e79b4cb4cd6bb0c30f.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_simple.py4
1 files changed, 1 insertions, 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()