Denver Coneybeare <denver.coneybe...@gmail.com> added the comment:

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.

----------
Added file: 
http://bugs.python.org/file18473/test_argparse.py.COLUMNS.update1.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9553>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to