-
-
Couldn't load subscription status.
- Fork 462
Open
Description
Summary
Recorded JSON expectations in tests/performance expect longer float representations than the current environment serializes. For example, tests expecting 0.011710000000000002 now see 0.01171, and 0.27404633746782125 becomes 0.2740463374678212. This causes recorder diffs without any code changes in the corresponding functions.
Steps to reproduce
- Run: pytest -q tests/performance/test_performance_model.py::test_get_covariance
- Expected (from json record): 0.011710000000000002
- Actual: 0.01171
- Run: pytest -q tests/performance/test_performance_model.py::test_get_beta
- Expected (from json record): 0.27404633746782125
- Actual: 0.2740463374678212
Observed behavior
- Recorder detects change due to float string serialization differences (Python uses shortest round‑trip float formatting in newer environments).
Expected behavior
- Tests pass with current records without recorder diffs.
Environment
- Branch: main (upstream)
- Python: recent version exhibiting shortest-repr float serialization
- No changes to performance_model.get_covariance/get_beta
Potential approaches (for maintainers’ consideration)
- Stabilize serialization for recorder outputs (e.g., format floats with a specified precision before json.dumps), or
- Update recorded expected JSON values to reflect shortest-repr floats.
Additional information
- This appears orthogonal to feature work and was surfaced while running the full suite. No changes proposed here; filing for visibility and guidance on preferred stabilization approach.
Metadata
Metadata
Assignees
Labels
No labels