Skip to content

fix(testing): read test case json as utf-8 - #872

Merged
jernejfrank merged 1 commit into
apache:mainfrom
Ghraven:fix/testcase-json-utf8-20260805
Aug 5, 2026
Merged

fix(testing): read test case json as utf-8#872
jernejfrank merged 1 commit into
apache:mainfrom
Ghraven:fix/testcase-json-utf8-20260805

Conversation

@Ghraven

@Ghraven Ghraven commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Problem

Burr's generated pytest test-case JSON path used the platform default encoding when appending fixtures from burr test-case create and when loading those fixtures through burr.testing.load_test_cases().

Those JSON files can contain serialized application state, prompts, responses, or user text. On systems whose default encoding is not UTF-8, fixtures with non-ASCII text can fail to load or be interpreted inconsistently.

Before / after

Before, the CLI writer and pytest helper opened test-case JSON files without specifying an encoding.

After, both the generated fixture writer and load_test_cases() read/write those JSON files with encoding="utf-8". A focused regression test writes a UTF-8 JSON fixture with literal non-ASCII text and verifies it loads with the expected test id and state payloads.

Verification

  • python -m pytest tests/test_testing.py tests/integrations/test_burr_pydantic_future_annotations.py
  • git diff --check

@jernejfrank
jernejfrank merged commit ecb6f0a into apache:main Aug 5, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants