changeset 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 4375d37fea1e
children 093ae2915b45
files tests/run.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run.py
+++ b/tests/run.py
@@ -70,7 +70,8 @@ if __name__ == '__main__':
         demandimport.enable()
 
     # silence output when running outside nose
-    sys.stdout = os.tmpfile()
+    import tempfile
+    sys.stdout = tempfile.TemporaryFile()
 
     all = tests()
     del all['test_util']