The principle
The library’s implementation works on integer codes. The tests check it against an oracle written separately on exact fractions, straight from the format’s definition, that never sees a code. The two must agree on the result and on the event for every case. Nothing is ever compared with a float tolerance.What runs when
CI runs the suite on Python 3.10, 3.12 and 3.13 on every push, plus the stage tours. Today: 732 tests per commit.
Running it yourself
SF_TEST_SEED and SF_TEST_RANDOM_PAIRS control the sampled widths. The golden code files under tests/golden/ are regenerated with python tools/make_golden.py only when the format definition itself changes.