gh-143429: Skip NaN encoding assertions for MIPS
Description
This PR skips some NaN encoding tests in Lib/test/test_struct.py for the MIPS architecture.
math.nan depends on toolchain settings for a MIPS build, as setting -mnan=legacy and -mnan=2008 result in different __builtin_nan behavior for GCC.
Tests
- Ran the official test suite: ./python -m test test_struct (Passed).
- Issue: gh-143429
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.
Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
@chenx97, could you check also test_pack_unpack_roundtrip_for_nans() in Lib/test/test_capi/test_float.py?
Is it enabled on your system? If so, it should fail too. If not, I suspect you could increase number of samples (10 for now) in this test.
@chenx97, could you check also test_pack_unpack_roundtrip_for_nans() in Lib/test/test_capi/test_float.py?
Is it enabled on your system? If so, it should fail too. If not, I suspect you could increase number of samples (10 for now) in this test.
I think the tests are expected to pass on mips64, as the parisc handling logic only runs for the 32-bit environment. Legacy mips32 fails here, as you guessed.
the parisc handling logic only runs for the 32-bit environment
Ah, you are right. (I just did a quick grepping and didn't look on the function code.)
Still, I think we could use new module variable also here, instead of the platform check.
Thanks @chenx97 for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. 🐍🍒⛏🤖 I'm not a witch! I'm not a witch!
GH-143595 is a backport of this pull request to the 3.14 branch.
Mergerd, thank you for your fix. It's good that the fix is no longer to skip the tests :-)