gh-128051: fix tests if sys.float_repr_style is 'legacy'#135908
Conversation
|
CC @vstinner Second commit contains more controversial changes, i.e. where short and legacy repr - agree (but this tested on IEEE box!) |
| self.assertRegex(repr(c_ulonglong.from_param(20000)), r"^<cparam '[LIQ]' \(20000\)>$") | ||
| self.assertEqual(repr(c_float.from_param(1.5)), "<cparam 'f' (1.5)>") | ||
| self.assertEqual(repr(c_double.from_param(1.5)), "<cparam 'd' (1.5)>") | ||
| self.assertEqual(repr(c_double.from_param(1e300)), "<cparam 'd' (1e+300)>") |
There was a problem hiding this comment.
Please don't remove tests. Maybe skip it if if getattr(sys, 'float_repr_style', '') == 'short':.
There was a problem hiding this comment.
Any idea why this was added, given we have other c_double test?
There was a problem hiding this comment.
Yes, I know. As well, as other tests in this function, but why? This value fits in double? We have only one test for float/longdouble.
|
We usually backport tests changes to stable branches to reduce the risk of merge conflicts for following tests changes. |
Co-authored-by: Victor Stinner <vstinner@python.org>
| WorseStruct().__setstate__({}, b'foo') | ||
|
|
||
| @unittest.skipUnless(sys.float_repr_style == 'short', | ||
| "applies only when using short float repr style") |
There was a problem hiding this comment.
I would prefer to only skip 1e300 test, rather than skipping the whole test method.
|
Thanks @skirpichev for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…nGH-135908) (cherry picked from commit f3aec60) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
|
Sorry, @skirpichev and @vstinner, I could not cleanly backport this to |
|
GH-136025 is a backport of this pull request to the 3.14 branch. |
|
GH-136026 is a backport of this pull request to the 3.13 branch. |
…n#135908) Co-authored-by: Victor Stinner <vstinner@python.org>
…n#135908) Co-authored-by: Victor Stinner <vstinner@python.org>
…n#135908) Co-authored-by: Victor Stinner <vstinner@python.org>
…n#135908) Co-authored-by: Victor Stinner <vstinner@python.org>
Uh oh!
There was an error while loading. Please reload this page.