[Python-checkins] python/dist/src/Lib/test test_getopt.py,1.9,1.10

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Tue Aug 3 17:54:48 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13814
Modified Files:
	test_getopt.py 
Log Message:
avoid fragility: make sure POSIXLY_CORRECT is completely controlled
for the tests, and restored properly when done
Index: test_getopt.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_getopt.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_getopt.py	3 Aug 2004 11:14:19 -0000	1.9
--- test_getopt.py	3 Aug 2004 15:54:45 -0000	1.10
***************
*** 17,20 ****
--- 17,24 ----
 raise failure
 
+ old_posixly_correct = os.environ.get("POSIXLY_CORRECT")
+ if old_posixly_correct is not None:
+ del os.environ["POSIXLY_CORRECT"]
+ 
 if verbose:
 print 'Running tests on getopt.short_has_arg'
***************
*** 125,129 ****
 verify(opts == [('-a', '')])
 verify(args == ['arg1', '-b', '1', '--alpha', '--beta=2'])
! del os.environ["POSIXLY_CORRECT"] 
 
 #------------------------------------------------------------------------------
--- 129,138 ----
 verify(opts == [('-a', '')])
 verify(args == ['arg1', '-b', '1', '--alpha', '--beta=2'])
! 
! 
! if old_posixly_correct is None:
! del os.environ["POSIXLY_CORRECT"]
! else:
! os.environ["POSIXLY_CORRECT"] = old_posixly_correct
 
 #------------------------------------------------------------------------------


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /