def test_reserveRaisesNonEMFILEExceptions(self):
        """
        Any exception raised while opening the reserve file that is
        not an L{OSError} or L{IOError} whose errno is C{EMFILE} is
        allowed through to the caller.
        """
        for errorClass in (OSError, IOError, ValueError):
            # Note that the ValueError will present the errno as its
            # value.
            def failsWith(errorClass=errorClass):
                raise errorClass(errno.EMFILE + 1, "message")

            reserveFD = _FileDescriptorReservation(failsWith)
            self.assertRaises(errorClass, reserveFD.reserve)

        Any exception raised while opening the reserve file that is
        not an L{OSError} or L{IOError} whose errno is C{EMFILE} is
        allowed through to the caller.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_tcp.py