From f7bed66a98e1a4e60d71722c8f4d8c5ef45eec5a Mon Sep 17 00:00:00 2001 From: Rio Yu <52408936+rioyu123@users.noreply.github.com> Date: Thu, 27 Aug 2026 01:21:43 +0800 Subject: [PATCH] fix(tests): read changelog as UTF-8 --- tests/test_changelog.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_changelog.py b/tests/test_changelog.py index be0f219c9..37a590d59 100644 --- a/tests/test_changelog.py +++ b/tests/test_changelog.py @@ -10,13 +10,13 @@ def test_changelog_exists(self): assert self.changelog_path.exists(), "CHANGELOG.md file should exist" def test_changelog_starts_with_header(self): - content = self.changelog_path.read_text() + content = self.changelog_path.read_text(encoding="utf-8") assert content.startswith("# Changelog"), ( "Changelog should start with '# Changelog'" ) def test_changelog_has_valid_version_format(self): - content = self.changelog_path.read_text() + content = self.changelog_path.read_text(encoding="utf-8") lines = content.split("\n") version_pattern = re.compile(r"^## \d+\.\d+\.\d+(?:\s+\(\d{4}-\d{2}-\d{2}\))?$") @@ -32,7 +32,7 @@ def test_changelog_has_valid_version_format(self): assert len(versions) > 0, "Changelog should contain at least one version" def test_changelog_has_bullet_points(self): - content = self.changelog_path.read_text() + content = self.changelog_path.read_text(encoding="utf-8") lines = content.split("\n") in_version_section = False @@ -61,7 +61,7 @@ def test_changelog_has_bullet_points(self): ) def test_changelog_versions_in_descending_order(self): - content = self.changelog_path.read_text() + content = self.changelog_path.read_text(encoding="utf-8") lines = content.split("\n") versions = [] @@ -77,7 +77,7 @@ def test_changelog_versions_in_descending_order(self): ) def test_changelog_no_empty_bullet_points(self): - content = self.changelog_path.read_text() + content = self.changelog_path.read_text(encoding="utf-8") lines = content.split("\n") for line in lines: