'Test writing with a read-only device.'

def test_unwritable(self, pyqiodev):

    pyqiodev.open(QIODevice.ReadOnly)
    with pytest.raises(OSError, match='Trying    to    write    to    unwritable    file!'):
        pyqiodev.write('')
