'Test methods with an unreadable device.
Args:
method: The name of the method to call.'

@pytest.mark.parametrize('method', ['readline', 'read'])
def test_unreadable(self, pyqiodev, method):

    pyqiodev.open(QIODevice.WriteOnly)
    func = getattr(pyqiodev, method)
    with pytest.raises(OSError, match='Trying    to    read    unreadable    file!'):
        func()
