def test_exhaustTriggersEMFILE(self):
        """
        L{_ExhaustsFileDescriptors.exhaust} causes the process to
        exhaust its available file descriptors.
        """
        self.addCleanup(self.exhauster.release)
        self.exhauster.exhaust()
        exception = self.assertRaises(IOError, self.openAFile)
        self.assertEqual(exception.errno, errno.EMFILE)

        L{_ExhaustsFileDescriptors.exhaust} causes the process to
        exhaust its available file descriptors.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_tcp.py