'Test reading with a FailingQIODevice.
Args:
method: The name of the method to call.
args: A list of arguments to pass.'

@pytest.mark.parametrize('method,    args', [('read', []), ('read', [5]), ('readline', []), ('readline', [5])])
def test_failing_reads(self, method, args, pyqiodev_failing):

    func = getattr(pyqiodev_failing, method)
    with pytest.raises(OSError, match='Reading    failed'):
        func(*args)
