def test_reserveEMFILELogged(self):
        """
        If reserving the file descriptor fails because of C{EMFILE},
        the exception is suppressed but logged and the reservation
        remains unavailable.
        """
        exhauster = _ExhaustsFileDescriptors()
        self.addCleanup(exhauster.release)
        exhauster.exhaust()

        self.assertFalse(self.reservedFD.available())
        self.reservedFD.reserve()
        self.assertFalse(self.reservedFD.available())

        errors = self.flushLoggedErrors(OSError, IOError)
        self.assertEqual(len(errors), 1)
        self.assertEqual(errors[0].value.errno, errno.EMFILE)

        If reserving the file descriptor fails because of C{EMFILE},
        the exception is suppressed but logged and the reservation
        remains unavailable.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_tcp.py