Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 07:15 UTC
fix(py): decode schema test corpora as UTF-8 (#5118)
This PR: - Closes #5104 - passes `encoding="utf-8"` to `load_object_cases()` and `load_strict_cases()` in `python/tests/fixtures/json_schema_conversion_corpus.py`, so the shared UTF-8 corpus decodes the same way on every locale (Windows cp936 turned `𝄞` into two code points and failed `primitive-unicode-code-point-length`) - adds `tests/test_json_schema_corpus.py`, which simulates a cp936 or cp1252 default encoding for `Path.read_text()` and checks both loaders keep a non-ASCII glyph intact - uses the patch @gtdd123 posted on their fork (https://github.com/gtdd123/composio/commit/e7de06642d0cbc5b259b69551af901bac07c96d1); they are credited as co-author - test-only change: no SDK behavior, fixture bytes, or release metadata change, so no changelog entry Other `read_text()`/`open()` calls under `python/tests` either already pass UTF-8 or read the webhook fixtures, which are not this corpus. Verification (from `python/`, `composio.__file__` checked to be this checkout): - before the fix, the new regression fails (4 failed); after, 4 passed - `LC_ALL=C PYTHONCOERCECLOCALE=0 PYTHONUTF8=0 pytest tests/test_json_schema_corpus.py tests/test_schema_primitive_parity.py tests/test_schema_composition_parity.py tests/test_schema_parser.py`: 274 passed (on `next` the primitive parity file alone fails 22/22 in this locale) - `pytest` over every corpus consumer (`test_cross_sdk_compatibility`, `test_provider`, `test_schema_*`, `test_strict_schema_corpus`, `test_json_schema_corpus`): 598 passed, 11 skipped - `ruff check` and `ruff format --check` (`config/ruff.toml`) clean; `mypy==2.3.1 --config-file config/mypy.ini` on both touched files: no issues Co-authored-by: gtdd123 <230968026+gtdd123@users.noreply.github.com>