zope.testrunner should only profile actual tests, not setup

Bug #159467 reported by Daniel Nouri on 2007-11-02
4
Affects Status Importance Assigned to Milestone
Zope 3
Undecided
Unassigned
zope.testing
Low
Roman Joost
zope.testrunner
Low
Roman Joost

Bug Description

I'm trying to use the testrunner to profile my application. For this, it appears that layer setup code isn't really interesting. Thus, I've written this patch to defer calls to profile.enable() and profile.disable() to when the actual testing happens.

Daniel Nouri (daniel.nouri) wrote :
Tres Seaver (tseaver) on 2010-04-15
Changed in zope3:
status: New → Won't Fix
Tres Seaver (tseaver) on 2010-04-21
tags: added: bugday20100424
Changed in zope.testing:
importance: Undecided → Low
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".

Changed in zope.testing:
assignee: nobody → Roman Joost (romanofski-two)
status: New → Incomplete
Tres Seaver (tseaver) on 2010-04-24
Changed in zope.testrunner:
status: New → Incomplete
importance: Undecided → Low
assignee: nobody → Roman Joost (romanofski-two)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers