test: use per-subtest TempDir in TestYAMLEmptyFileRejection
PR Ready Gate / clear-labels (pull_request) Successful in 2s
CI / test (pull_request) Successful in 17s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 44s
CI / review (gpt-5, security, ., rodin/security-patterns, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 1m42s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 2m9s

Move t.TempDir() inside each subtest for idiomatic test isolation,
as suggested by reviewers.
This commit is contained in:
claw
2026-05-12 15:22:27 -07:00
parent 493349e11a
commit 0b16c4143a
+1 -2
View File
@@ -490,8 +490,6 @@ func TestYAMLDeeplyNestedRejection(t *testing.T) {
}
func TestYAMLEmptyFileRejection(t *testing.T) {
dir := t.TempDir()
tests := []struct {
name string
content string
@@ -503,6 +501,7 @@ func TestYAMLEmptyFileRejection(t *testing.T) {
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
dir := t.TempDir()
path := filepath.Join(dir, tc.name+".yaml")
if err := os.WriteFile(path, []byte(tc.content), 0644); err != nil {
t.Fatalf("failed to write test file: %v", err)