def test_headersMustBeSequence(self):
        """
        The headers passed to the I{start_response} callable MUST be a
        sequence.
        """
        headers = [("key", "value")]

        def application(environ, startResponse):
            startResponse("200 OK", iter(headers))
            return iter(())

        request, result = self.prepareRequest(application)
        request.requestReceived()

        def checkMessage(error):
            self.assertRegex(
                str(error), "headers must be a list, not "
                r"<(list_?|sequence)iterator .+> [(]\1iterator[)]")

        return self.assertFailure(result, TypeError).addCallback(checkMessage)

        The headers passed to the I{start_response} callable MUST be a
        sequence.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_wsgi.py