I'd suggest a cleaner approach:
```python
with self.mock_role_method("remove_dir") as remove:
    remove.side_effect = IOError()
```
But I'm OK with the current implementation. Just thought you might prefer to use the helper methods we have.