Skip to content

Commit 5026c83

Browse files
committed
fix: TestResetFlagToDefault uses NewTestKit per cmd test harness convention
CodeRabbit follow-up on PR #3022: this test builds its own local pflag.FlagSet rather than touching RootCmd, but cmd package tests must still call NewTestKit(t) per repo convention, for consistency and to guard against future edits that do touch global state.
1 parent e02f3a6 commit 5026c83

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cmd/testkit_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ func TestTestKit_RestoresAtmosConfig(t *testing.T) {
327327
// --version flag's DefValue to "" for cleaner help output, and pflag's bool
328328
// Set("") fails, so a naive Set(DefValue) would leave a leaked true in place.
329329
func TestResetFlagToDefault(t *testing.T) {
330+
_ = NewTestKit(t)
331+
330332
fs := pflag.NewFlagSet("test", pflag.ContinueOnError)
331333
fs.Bool("version", false, "")
332334
fs.String("stack", "", "")

0 commit comments

Comments
 (0)