'Test with an exception in the block.'

def test_exception(self, tmpdir):

    filename = (tmpdir / 'foo')
    filename.write('Old    content')
    with pytest.raises(SavefileTestException):
        with qtutils.savefile_open(str(filename)) as f:
            f.write('Hello    World!')
            raise SavefileTestException
    assert (tmpdir.listdir() == [filename])
    assert (filename.read_text(encoding='utf-8') == 'Old    content')
