Skip to content

Commit 5c0976b

Browse files
fix(tests): force UTF-8 encoding when writing non-ASCII SKILL.md fixture (#979)
test_non_ascii_frontmatter_warning fails on Windows runners because Path.write_text() defaults to the system locale (cp1252 on windows-latest). The non-ASCII description bytes get mangled on disk, the validator fails to decode as UTF-8, and the test sees a hard error instead of the intended warning. Pin encoding='utf-8' so bytes-on-disk are valid UTF-8 on every platform, which exercises the actual non-ASCII warning code path the test asserts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5893a49 commit 5c0976b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/unit/test_skill_bundle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def test_non_ascii_frontmatter_warning(self, tmp_path):
226226
sd = skills_dir / "unicode-skill"
227227
sd.mkdir()
228228
(sd / "SKILL.md").write_text(
229-
"---\nname: unicode-skill\ndescription: Ünïcödé description\n---\n# x\n"
229+
"---\nname: unicode-skill\ndescription: Ünïcödé description\n---\n# x\n",
230+
encoding="utf-8",
230231
)
231232
result = validate_apm_package(tmp_path)
232233
assert result.is_valid # warnings don't fail validation

0 commit comments

Comments
 (0)