aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index ce6bd91cc72..152ba935762 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -27,6 +27,7 @@ import codecs
import decimal
import fractions
import pickle
+import sysconfig
try:
import threading
except ImportError:
@@ -1053,6 +1054,12 @@ class URandomTests(unittest.TestCase):
data2 = self.get_urandom_subprocess(16)
self.assertNotEqual(data1, data2)
+
+HAVE_GETENTROPY = (sysconfig.get_config_var('HAVE_GETENTROPY') == 1)
+
+@unittest.skipIf(HAVE_GETENTROPY,
+ "getentropy() does not use a file descriptor")
+class URandomFDTests(unittest.TestCase):
@unittest.skipUnless(resource, "test requires the resource module")
def test_urandom_failure(self):
# Check urandom() failing when it is not able to open /dev/random.