mirror of https://github.com/MagicStack/uvloop.git
Add a test that uvloop doesn't set FD_CLOEXEC to stdin/stdout/stderr
Issue #40.
This commit is contained in:
parent
af4ab228dc
commit
575f71bdbe
|
@ -1,4 +1,5 @@
|
|||
import asyncio
|
||||
import fcntl
|
||||
import logging
|
||||
import threading
|
||||
import time
|
||||
|
@ -505,6 +506,12 @@ class TestBaseUV(_TestBase, UVTestCase):
|
|||
self.assertIs(fut._loop, self.loop)
|
||||
fut.cancel()
|
||||
|
||||
def test_loop_std_files_cloexec(self):
|
||||
# See https://github.com/MagicStack/uvloop/issues/40 for details.
|
||||
for fd in {0, 1, 2}:
|
||||
flags = fcntl.fcntl(fd, fcntl.F_GETFD)
|
||||
self.assertFalse(flags & fcntl.FD_CLOEXEC)
|
||||
|
||||
|
||||
class TestBaseAIO(_TestBase, AIOTestCase):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue