summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_profile.py
Commit message (Collapse)AuthorAgeFilesLines
* Some tests did not pass on repeated calls (regrtest -R::)Amaury Forgeot d'Arc2008-04-181-2/+3
| | | | Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry.
* * Use the same code to profile for test_profile and test_cprofile.Georg Brandl2008-02-051-114/+157
| | | | | | | | * Convert both to unittest. * Use the same unit testing code. * Include the expected output in both test files. * Make it possible to regenerate the expected output by running the file as a script with an '-r' argument.
* Added the cProfile module.Armin Rigo2006-02-081-50/+54
| | | | | | | | | | | | | | | | | | | | | | | Based on lsprof (patch #1212837) by Brett Rosen and Ted Czotter. With further editing by Michael Hudson and myself. History in svn repo: http://codespeak.net/svn/user/arigo/hack/misc/lsprof * Module/_lsprof.c is the internal C module, Lib/cProfile.py a wrapper. * pstats.py updated to display cProfile's caller/callee timings if available. * setup.py and NEWS updated. * documentation updates in the profiler section: - explain the differences between the three profilers that we have now - profile and cProfile can use a unified documentation, like (c)Pickle - mention that hotshot is "for specialized usage" now - removed references to the "old profiler" that no longer exists * test updates: - extended test_profile to cover delicate cases like recursion - added tests for the caller/callee displays - added test_cProfile, performing the same tests for cProfile * TO-DO: - cProfile gives a nicer name to built-in, particularly built-in methods, which could be backported to profile. - not tested on Windows recently!
* test and fix for buggy handling of exceptions raised by C functions,Armin Rigo2005-09-201-2/+21
| | | | | causing the profiler to crash on an AssertionError if the same Python function catches multiple exceptions from C functions.
* Whitespace normalization.Tim Peters2004-07-081-8/+8
|
* Added global runctx function to profile to fix SF Bug #716587Nicholas Bastin2004-03-221-0/+14
|
* Whitespace normalization.Tim Peters2001-10-041-1/+1
|
* Hopefully fix the profiler right. Add a test suite that checks thatGuido van Rossum2001-10-041-0/+86
it deals correctly with some anomalous cases; according to this test suite I've fixed it right. The anomalous cases had to do with 'exception' events: these aren't generated when they would be most helpful, and the profiler has to work hard to recover the right information. The problems occur when C code (such as hasattr(), which is used as the example here) calls back into Python code and clears an exception raised by that Python code. Consider this example: def foo(): hasattr(obj, "bar") Where obj is an instance from a class like this: class C: def __getattr__(self, name): raise AttributeError The profiler sees the following sequence of events: call (foo) call (__getattr__) exception (in __getattr__) return (from foo) Previously, the profiler would assume the return event returned from __getattr__. An if statement checking for this condition and raising an exception was commented out... This version does the right thing.