def METHOD_NAME(salt_call_cli, wait_for_pillar_refresh_complete):
    grain = AppendGrain()
    try:
        # Start off with an empty list
        start_time = time.time()
        ret = salt_call_cli.run("grains.setval", grain.key, val=[])
        assert ret.returncode == 0
        assert ret.data
        assert ret.data == {grain.key: []}
        # Let's wait for the pillar refresh, at which stage we know grains are also refreshed
        wait_for_pillar_refresh_complete(start_time)
        yield grain
    finally:
        start_time = time.time()
        ret = salt_call_cli.run("grains.delkey", grain.key, force=True)
        assert ret.returncode == 0
        assert ret.data
        # Let's wait for the pillar refresh, at which stage we know grains are also refreshed
        wait_for_pillar_refresh_complete(start_time)