comparison tests/run.py @ 629:c38fe89a5cbc

tests: Use tempfile.TemporaryFile instead of os.tmpfile() to redirect stdout. os.tmpfile requires administrator privileges on Windows XP and may be blocked by UAC on Windows Vista/7. In any case, it is deprecated in favour of tempfile.TemporaryFile. See http://bugs.python.org/issue2232
author James McKay <code@jamesmckay.net>
date Sun, 04 Jul 2010 21:41:42 +0100
parents edd112855189
children 95abc4cfc78f
comparison
equal deleted inserted replaced
628:4375d37fea1e 629:c38fe89a5cbc
68 if options.demandimport: 68 if options.demandimport:
69 from mercurial import demandimport 69 from mercurial import demandimport
70 demandimport.enable() 70 demandimport.enable()
71 71
72 # silence output when running outside nose 72 # silence output when running outside nose
73 sys.stdout = os.tmpfile() 73 import tempfile
74 sys.stdout = tempfile.TemporaryFile()
74 75
75 all = tests() 76 all = tests()
76 del all['test_util'] 77 del all['test_util']
77 78
78 args = [i.split('.py')[0].replace('-', '_') for i in args] 79 args = [i.split('.py')[0].replace('-', '_') for i in args]