def test_methodWithNonASCIIRejected(self):
        """
        Issuing a request with a method that contains non-ASCII
        characters fails with a L{ValueError}.
        """
        for c in NONASCII:
            method = b"GET%s" % (bytearray([c]),)
            with self.assertRaises(ValueError) as cm:
                self.attemptRequestWithMaliciousMethod(method)
            self.assertRegex(str(cm.exception), "^Invalid method")

        Issuing a request with a method that contains non-ASCII
        characters fails with a L{ValueError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/injectionhelpers.py