OptimisingTestSuite is a bit wasteful with @skip-decorated tests

Bug #1556979 reported by Free Ekanayaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testresources
Triaged
Wishlist
Unassigned

Bug Description

If a test is decorated with the @unittest.skip, we know upfront that is not going to be run. Still OptimisingTestSuite builds the resources for it. I think there's room for being a bit more smart here.

Take the attached sample script (run it with "python test_foo.py"), you'll see that "make some resource" gets printed in the standard output even if the test is skipped altogether.

I'm attaching a sketch of a patch that would improve the situation, for these cases that we already know that the test will be skipped. If you think it's a viable solution I might port it to a proper branch with tests.

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :
Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Sketch patch for avoiding building resources unnecessarily when we know upfront that a test will be skipped.

Revision history for this message
Robert Collins (lifeless) wrote :

That sketch looks viable. However, rather than peeking under the hood, lets add a helper function to unittest to query for these statically determinable things - then we can consume that from unittest2.

Changed in testresources:
status: New → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.