[pypy-svn] r74539 - pypy/trunk/pypy/module/cpyext/test

afa at codespeak.net afa at codespeak.net
Tue May 18 10:57:28 CEST 2010


Author: afa
Date: Tue May 18 10:57:26 2010
New Revision: 74539

Modified:
   pypy/trunk/pypy/module/cpyext/test/test_api.py
Log:
Fix refcount checks when the test contains an applevel print:
we force sys.stdout to allocate its file lock before tests are run.


Modified: pypy/trunk/pypy/module/cpyext/test/test_api.py
==============================================================================
--- pypy/trunk/pypy/module/cpyext/test/test_api.py	(original)
+++ pypy/trunk/pypy/module/cpyext/test/test_api.py	Tue May 18 10:57:26 2010
@@ -22,12 +22,15 @@
 
         # warm up reference counts:
         # - the posix module allocates a HCRYPTPROV on Windows
-        # - writing to stderr allocates a file lock
+        # - writing to stdout and stderr allocates a file lock
         space.getbuiltinmodule("cpyext")
         space.getbuiltinmodule(os.name)
         space.call_function(space.getattr(space.sys.get("stderr"),
                                           space.wrap("write")),
                             space.wrap(""))
+        space.call_function(space.getattr(space.sys.get("stdout"),
+                                          space.wrap("write")),
+                            space.wrap(""))
 
         class CAPI:
             def __getattr__(self, name):



More information about the Pypy-commit mailing list