Also, it's better to do this as:

```python
if 'testing' not in self.config['alm_phases']:
    return super(HPAlmConnector, self).prune_tasks(tasks)

# Extract non-testing in-scope tasks
dev_tasks = [t for t in tasks if self.in_scope(task) and task['phase'] != 'testing']

# Extract those task's weakness IDs.
weakness_ids = set(t['weakness']['id'] for t in dev_tasks)
...
...
```