'Test open() which fails (because it\'s an existent directory).'

def test_failing_open(self, tmpdir):

    qf = QFile(str(tmpdir))
    dev = qtutils.PyQIODevice(qf)
    with pytest.raises(qtutils.QtOSError) as excinfo:
        dev.open(QIODevice.WriteOnly)
    assert (excinfo.value.qt_errno == QFileDevice.OpenError)
    assert dev.closed
