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
This looks like a probable solution:
def run(self, result):
self.sortTests ()
current_ resources = set()
break test._get_ test_method( ), '__unittest_ skip__' , False):
resources = getattr(test, 'resources', [])
new_resources = set()
new_ resources. update( resource. neededResources ())
self. switch( current_ resources, new_resources, result)
current_ resources = new_resources
test( result)
self.switch( current_ resources, set(), result)
for test in self._tests:
if result.shouldStop:
if not getattr(
for name, resource in resources:
return result