[pypy-svn] r70450 - pypy/trunk/pypy/interpreter/test

arigo at codespeak.net arigo at codespeak.net
Fri Jan 8 13:15:31 CET 2010


Author: arigo
Date: Fri Jan  8 13:15:31 2010
New Revision: 70450

Modified:
   pypy/trunk/pypy/interpreter/test/test_pyframe.py
Log:
Cannot print while sys.settracing().  If run with py.test
without the -s option, it will trace the py lib output
capturing logic.


Modified: pypy/trunk/pypy/interpreter/test/test_pyframe.py
==============================================================================
--- pypy/trunk/pypy/interpreter/test/test_pyframe.py	(original)
+++ pypy/trunk/pypy/interpreter/test/test_pyframe.py	Fri Jan  8 13:15:31 2010
@@ -381,12 +381,13 @@
     def test_trace_while_blackholing(self):
         import sys
         l = []
+        printed = []
         def trace(frame, event, arg):
             l.append((frame.f_code.co_name, event))
             return trace
         def g(i, x):
             if i > x - 10:
-                print i
+                printed.append(i)
             if i == x - 5:
                 sys.settrace(trace)
 
@@ -398,10 +399,13 @@
 
         f(10)
         sys.settrace(None)
+        print printed
         assert l == [('g', 'call'), ('g', 'line'), ('g', 'line'), ('g', 'line'), ('g', 'return')] * 4
         l1 = l
         l = []
+        printed = []
         f(10000)
         sys.settrace(None)
+        print printed
 
         assert l == l1



More information about the Pypy-commit mailing list