def METHOD_NAME(tmp_file, capture_stdout):
    svcname = "pytest"
    assert Mgr()(argv=["-s", svcname, "create", "--kw", "env.foo=bar"]) == 0
    assert Mgr()(argv=["-s", svcname, "set", "--kw", "env.foo=BAR", "--local"]) == 0
    with capture_stdout(tmp_file):
        assert Mgr()(argv=["-s", svcname, "print", "config", "--format", "json"]) == 0
    assert json.load(open(tmp_file, "r"))["env"]["foo"] == "BAR"