mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Extract _codecs._normalize_encoding and delegate encodings.normalize_encoding to it using the final CPython 3.15 library source. Preserve case and dots, validate UTF-8 before NUL truncation, and retain wrapper warnings and bytes conversion. Add bounded regression assertions without changing registry keys. Lib/encodings/__init__.py was updated via scripts/update_lib migrate from CPython d220409a13b77de7a6c30abe16ea90db01528edc, with byte-identical output. AI assistance: OpenAI Codex implemented and source-reviewed this split, ran update_lib, prepared bounded regressions and performed focused automated validation. No human manual testing is claimed. Assisted-by: OpenAI Codex:model version unavailable
Test snippets
This directory contains two sets of test snippets which can be run in Python.
The snippets/ directory contains functional tests, and the benchmarks/
directory contains snippets for use in benchmarking RustPython's performance.
Setup
Our testing depends on pytest, which you can install using pip.
Running
Simply run pytest -v in this directory, and the tests should run (and hopefully
pass). If it hangs for a long time, that's because it's building RustPython in
release mode, which should take less time than it would to run every test
snippet with RustPython compiled in debug mode.