-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pytest fails with python 3.12b4 possibly due to Fraction formatting change #1818
Comments
I believe this is due to python3.12 formatting change for Fraction. With python 3.11:
With python 3.12b4:
So python 3.11 raised Line 67 in 2d649ea
TypeError was caught here), however with python 3.12b4 this fails.
|
The above errors are all resolved by the following (not knowing this is desired, although)
|
Thanks for catching this. Would you mind issuing a PR? |
python 3.12 supports float-style formatting for Fraction by python/cpython#100161 . With this change, when ":n" format specifier is used in format() for Fraction type, this now raises ValueError instead of previous TypeError. To make pytest succeed with python 3.12, make pint.testing.assert_allclose also rescue ValueError . Fixes hgrecco#1818 .
With python 3.12b4 (actually on Fedora 39, python3-3.12.0~b4-1.fc39.x86_64), pytest for pint git head ( 2d649ea ) fails as below:
... and all of the above failures are like:
The text was updated successfully, but these errors were encountered: