def METHOD_NAME(self):
    def error(args, regex=None):
        old_stderr = sys.stderr
        stderr = sys.stderr = StringIO()
        try:
            self.assertRaises(SystemExit, parse_command_line, list(args))
        finally:
            sys.stderr = old_stderr
        msg = stderr.getvalue().strip()
        self.assertTrue(msg)
        if regex:
            self.assertTrue(re.search(regex, msg),
                            '"%s" does not match search "%s"' %
                            (msg, regex))
    error(['-1'],
          'Unknown compiler flag: -1')
    error(['-I'])
    error(['--version=-a'])
    error(['--version=--annotate=true'])
    error(['--working'])
    error(['--verbose=1'])
    error(['--cleanup'])
    error(['--debug-disposal-code-wrong-name', 'file3.pyx'],
          "Unknown debug flag: debug_disposal_code_wrong_name")
    error(['--module-name', 'foo.pyx'])
    error(['--module-name', 'foo.bar'])
    error(['--module-name', 'foo.bar', 'foo.pyx', 'bar.pyx'],
          "Only one source file allowed when using --module-name")
    error(['--module-name', 'foo.bar', '--timestamps', 'foo.pyx'],
          "Cannot use --module-name with --timestamps")