Greg Ward added the comment: > I've turned ash's test program into a bunch of test cases against > Python 3.5 trunk. Is it worth committing them?
Yeah, probably. Review comments... + try: + self.parser.error(RUSSIAN_TEXT) + except InterceptedError: + pass Why not self.assertRaises()? Also, when I run the test on its own, it prints ''' Usage: regrtest.py [options] regrtest.py: error: Русский текст --unknown ''' to stderr. Probably need to fiddle with sys.stderr to fix that. Blech. Finally: + try: + import optparse + old_gettext = optparse._ + optparse._ = dummy_gettext + + try: + OptionParser().parse_args(["--unknown"]) + except SystemExit: + pass + finally: + optparse._ = old_gettext This is a lot easier with mock. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue2931> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com