This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gward
Recipients akuchling, aronacher, ash, bethard, eric.araujo, ezio.melotti, gward, ivilata, loewis, sampablokuper, vstinner
Date 2015-04-15.13:15:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429103710.18.0.412244970854.issue2931@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2015-04-15 13:15:10gwardsetrecipients: + gward, loewis, akuchling, bethard, ivilata, vstinner, aronacher, ezio.melotti, ash, eric.araujo, sampablokuper
2015-04-15 13:15:10gwardsetmessageid: <1429103710.18.0.412244970854.issue2931@psf.upfronthosting.co.za>
2015-04-15 13:15:10gwardlinkissue2931 messages
2015-04-15 13:15:09gwardcreate