def METHOD_NAME(tmp_path, env):
    # python 3.5 // tmp_path must be converted to str
    with mock.patch("jupyter_client.kernelspec.SYSTEM_JUPYTER_PATH", [str(tmp_path)]):
        install(env=env)
    spec = tmp_path / "kernels" / KERNEL_NAME / "kernel.json"
    with spec.open() as f:
        spec = json.load(f)
    if env:
        assert len(env) == len(spec["env"])
        for k, v in env.items():
            assert spec["env"][k] == v
    else:
        assert "env" not in spec