[PATCH] Fix test-demandimport and test-trusted under Windows

James Abbatiello abbeyj at gmail.com
Tue Jul 14 21:50:14 CDT 2009


# HG changeset patch
# User James Abbatiello <abbeyj at gmail.com>
# Date 1247625492 14400
# Node ID ead71bffb136594e2212e6ee0e43ce018f16206c
# Parent  294c5e460b369a383fb85b4985b60b5d06b33853
Fix test-demandimport and test-trusted under Windows

The Windows-only wrapper around stdout is causing both of these tests to fail.
test-demandimport fails because it tries to print repr(sys.stdout).  Use
stderr instead since that is not wrapped.

test-trusted fails because the wrapper doesn't handle softspace and an
unexpected extra space gets printed.

diff -r 294c5e460b36 -r ead71bffb136 mercurial/windows.py
--- a/mercurial/windows.py	Tue Jul 14 12:18:22 2009 -0500
+++ b/mercurial/windows.py	Tue Jul 14 22:38:12 2009 -0400
@@ -41,6 +41,7 @@
             limit = 16000
             l = len(s)
             start = 0
+            self.softspace = 0;
             while start < l:
                 end = start + limit
                 self.fp.write(s[start:end])
diff -r 294c5e460b36 -r ead71bffb136 tests/test-demandimport.py
--- a/tests/test-demandimport.py	Tue Jul 14 12:18:22 2009 -0500
+++ b/tests/test-demandimport.py	Tue Jul 14 22:38:12 2009 -0400
@@ -36,5 +36,5 @@
 print "fred =", f(fred)

 print "re =", f(re)
-print "re.stdout =", f(re.stdout)
+print "re.stderr =", f(re.stderr)
 print "re =", f(re)
diff -r 294c5e460b36 -r ead71bffb136 tests/test-demandimport.py.out
--- a/tests/test-demandimport.py.out	Tue Jul 14 12:18:22 2009 -0500
+++ b/tests/test-demandimport.py.out	Tue Jul 14 22:38:12 2009 -0400
@@ -11,5 +11,5 @@
 fred.sub = <function sub at 0x?>
 fred = <proxied module 're'>
 re = <unloaded module 'sys'>
-re.stdout = <open file '<stdout>', mode 'w' at 0x?>
+re.stderr = <open file '<stderr>', mode 'w' at 0x?>
 re = <proxied module 'sys'>


More information about the Mercurial-devel mailing list