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 denversc
Recipients benjamin.peterson, bethard, brian.curtin, denversc, eric.araujo, eric.smith, r.david.murray
Date 2010-08-11.03:18:22
SpamBayes Score 5.475582e-05
Marked as misclassified No
Message-id <1281496704.93.0.976332048798.issue9553@psf.upfronthosting.co.za>
In-reply-to
Content
That is a very good point, bethard, that setting os.environ["COLUMNS"] in my suggested patch (test_argparse.py.COLUMNS.patch) is global and should be test-local.  I've attached an updated patch (test_argparse.py.COLUMNS.update1.patch) which uses setUp() and tearDown() to prepare and restore the COLUMNS environment variable.  The one difference from my previous patch is that instead of setting the COLUMNS environment variable to 80 I just unset it.

I also considered EnvironmentVarGuard, as suggested by r.david.murray, but I'm not sure it's designed for global setting of environment variables.  EnvironmentVarGuard appears to have been designed to be used as a context manager for an individual test, but the COLUMNS environment variable needs to be adjusted for *every* test.
History
Date User Action Args
2010-08-11 03:18:25denverscsetrecipients: + denversc, bethard, eric.smith, benjamin.peterson, eric.araujo, r.david.murray, brian.curtin
2010-08-11 03:18:24denverscsetmessageid: <1281496704.93.0.976332048798.issue9553@psf.upfronthosting.co.za>
2010-08-11 03:18:23denversclinkissue9553 messages
2010-08-11 03:18:23denversccreate