diff --git a/tests/test_base.py b/tests/test_base.py index 5b1f0ff..57bc6c3 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -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