OptimisedTestSuite should not .switch() for tests which are marked skip

Bug #1301711 reported by Leah Klearman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testresources
Triaged
Wishlist
Unassigned

Bug Description

Drives me crazy when it spends forever setting up resources, just to report a skip when it's done.

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

This would be a lovely feature.

Changed in testresources:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Leah Klearman (lklrmn) wrote :

This looks like a probable solution:

    def run(self, result):
        self.sortTests()
        current_resources = set()
        for test in self._tests:
            if result.shouldStop:
                break
            if not getattr(test._get_test_method(), '__unittest_skip__', False):
                resources = getattr(test, 'resources', [])
                new_resources = set()
                for name, resource in resources:
                    new_resources.update(resource.neededResources())
                self.switch(current_resources, new_resources, result)
                current_resources = new_resources
            test(result)
        self.switch(current_resources, set(), result)
        return result

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.