summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-02-23 11:06:22 +0100
committerHelmut Grohne <helmut@subdivi.de>2024-02-23 11:06:22 +0100
commit9446989a1f2f06a3829a7024231a252344fb40eb (patch)
tree1e64e747f9dc34cc91477a2fe2c123842d9c8762 /tests
parent1bb54225263fc29beb2b68f723e105c213ded912 (diff)
downloadpython-linuxnamespaces-9446989a1f2f06a3829a7024231a252344fb40eb.tar.gz
tests: consider that EventFD.aread might not return a future
Diffstat (limited to 'tests')
-rw-r--r--tests/test_simple.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_simple.py b/tests/test_simple.py
index b6f5c42..63f7804 100644
--- a/tests/test_simple.py
+++ b/tests/test_simple.py
@@ -51,11 +51,11 @@ class IDAllocationTest(unittest.TestCase):
class EventFDTest(unittest.IsolatedAsyncioTestCase):
async def test_async(self) -> None:
efd = linuxnamespaces.EventFD(1, linuxnamespaces.EventFDFlags.NONBLOCK)
- fut = efd.aread()
+ fut = asyncio.ensure_future(efd.aread())
await asyncio.sleep(0.000001) # Let the loop run
self.assertTrue(fut.done())
self.assertEqual(await fut, 1)
- fut = efd.aread()
+ fut = asyncio.ensure_future(efd.aread())
await asyncio.sleep(0.000001) # Let the loop run
self.assertFalse(fut.done())
efd.write()