Comment 2 for bug 159467

Revision history for this message
Roman Joost (romanofski) wrote :

I've had a look at this. Unfortunately the submitted patch doesn't apply anymore, because the code has already been refactored a lot.

Currently the profiler is enabled before the layer is setup:

    zope.testing.testrunner.profiling.py:125 (late_setup)

and stopped after all tests ran, but before the layer is teared down:

    zope.testing.testrunner.profiling.py:126 (early_teardown)

Please also check zope.testing.testrunner.feature.Feature for all the stages.

Now here's the thing: it looks like your suggested solution is only half implemented. To avoid the layer setup showing up, the profiler needs to be started/stopped multiple times (after/before each test_setup, test_teardown to be precise), but apparently this doesn't work with hotshot. I checked the python doc for hotshot and it appears to me, that it doesn't provide some kind of cumulative feature.

Did you intend with your patch to start/stop hotshot multiple times? If so, how is that supposed to work? If not, the profiler disable method should be set to "layer_setup".