'Test with the file being closed before committing.'

def test_failing_commit(self, tmpdir):

    filename = (tmpdir / 'foo')
    with pytest.raises(OSError, match='Commit    failed!'):
        with qtutils.savefile_open(str(filename), binary=True) as f:
            f.write('Hello')
            f.dev.cancelWriting()
    assert (tmpdir.listdir() == [])
