[pypy-svn] r58898 - pypy/branch/builtin-profiling/pypy/interpreter/test
arigo at codespeak.net
arigo at codespeak.net
Fri Oct 10 13:04:23 CEST 2008
Author: arigo
Date: Fri Oct 10 13:04:23 2008
New Revision: 58898
Modified:
pypy/branch/builtin-profiling/pypy/interpreter/test/test_executioncontext.py
Log:
(antocuni, arigo)
Added another test. Passes.
Modified: pypy/branch/builtin-profiling/pypy/interpreter/test/test_executioncontext.py
==============================================================================
--- pypy/branch/builtin-profiling/pypy/interpreter/test/test_executioncontext.py (original)
+++ pypy/branch/builtin-profiling/pypy/interpreter/test/test_executioncontext.py Fri Oct 10 13:04:23 2008
@@ -174,3 +174,22 @@
""")
events = space.unwrap(w_events)
assert events == ['return', 'call', 'return', 'return', 'c_call']
+
+ def test_c_call_profiles_immediately(self):
+ space = self.space
+ w_events = space.appexec([], """():
+ import sys
+ l = []
+ def profile(frame, event, arg):
+ l.append(event)
+
+ def bar():
+ sys.setprofile(profile)
+ max(3, 4)
+
+ bar()
+ sys.setprofile(None)
+ return l
+ """)
+ events = space.unwrap(w_events)
+ assert events == ['c_call', 'c_return', 'return', 'c_call']
More information about the Pypy-commit
mailing list