Read UTF-8 test fixtures with explicit encoding (#3245)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
6e304527a5
commit
2378e560fb
2 changed files with 2 additions and 2 deletions
|
|
@ -38,7 +38,7 @@ else: # pragma: lax no cover
|
||||||
STORIES_DIR = Path(stories.__file__).parent
|
STORIES_DIR = Path(stories.__file__).parent
|
||||||
BASE_URL = "http://127.0.0.1:8000"
|
BASE_URL = "http://127.0.0.1:8000"
|
||||||
|
|
||||||
MANIFEST = tomllib.loads((STORIES_DIR / "manifest.toml").read_text())
|
MANIFEST = tomllib.loads((STORIES_DIR / "manifest.toml").read_text(encoding="utf-8"))
|
||||||
DEFAULTS: dict[str, Any] = MANIFEST["defaults"]
|
DEFAULTS: dict[str, Any] = MANIFEST["defaults"]
|
||||||
STORIES: dict[str, dict[str, Any]] = MANIFEST["story"]
|
STORIES: dict[str, dict[str, Any]] = MANIFEST["story"]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ _LOWLEVEL_STORIES = [name for name in sorted(STORIES) if story_cfg(name)["lowlev
|
||||||
|
|
||||||
def _parse(path: Path) -> ast.Module:
|
def _parse(path: Path) -> ast.Module:
|
||||||
"""Parse ``path`` into an AST module."""
|
"""Parse ``path`` into an AST module."""
|
||||||
return ast.parse(path.read_text(), filename=str(path))
|
return ast.parse(path.read_text(encoding="utf-8"), filename=str(path))
|
||||||
|
|
||||||
|
|
||||||
def _resolve(node: ast.ImportFrom, package: str) -> str:
|
def _resolve(node: ast.ImportFrom, package: str) -> str:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue