]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #12105: test_posix, add the value of O_CLOEXEC in the error message
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 23 May 2011 10:54:52 +0000 (12:54 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 23 May 2011 10:54:52 +0000 (12:54 +0200)
Lib/test/test_posix.py

index 9c2cac394fbdf2c9aa7e287b29a3e9cd648a6424..07e6b082e6381da5201c0d92015644006e5d0295 100644 (file)
@@ -312,7 +312,8 @@ class PosixTester(unittest.TestCase):
     def test_oscloexec(self):
         fd = os.open(support.TESTFN, os.O_RDONLY|os.O_CLOEXEC)
         self.addCleanup(os.close, fd)
-        self.assertTrue(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC)
+        self.assertTrue(fcntl.fcntl(fd, fcntl.F_GETFD) & fcntl.FD_CLOEXEC,
+                        'CLOEXEC flag not set (O_CLOEXEC=0x%x)' % os.O_CLOEXEC)
 
     def test_osexlock(self):
         if hasattr(posix, "O_EXLOCK"):