Created
October 30, 2019 07:50
-
-
Save Peaker/958c760e28a1994ba9c931b2383c901e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from contextlib import contextmanager | |
@contextmanager | |
def injected_fault(params): | |
fault_manager.inject(params) | |
try: | |
yield | |
finally: | |
fault_manager.clear(params) | |
def some_test(): | |
with injected_fault("disk_failure", offset): | |
expect_exception(EIO, read file ...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment