Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.2k
gh-128051: fix tests if sys.float_repr_style is 'legacy'#135908
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
33f984f
57f4824
5105ce2
2ccc403
c0ee947
46c798a
878b6a8
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import sys | ||
import unittest | ||
import test.support | ||
from ctypes import (CDLL, PyDLL, ArgumentError, | ||
@@ -240,7 +241,8 @@ def test_parameter_repr(self): | ||
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)>") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Please don't remove tests. Maybe skip it if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Any idea why this was added, given we have other There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. The test was added by commit916610e. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. 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. | ||
if sys.float_repr_style == 'short': | ||
self.assertEqual(repr(c_double.from_param(1e300)), "<cparam 'd' (1e+300)>") | ||
self.assertRegex(repr(c_longdouble.from_param(1.5)), r"^<cparam ('d' \(1.5\)|'g' at 0x[A-Fa-f0-9]+)>$") | ||
self.assertRegex(repr(c_char_p.from_param(b'hihi')), r"^<cparam 'z' \(0x[A-Fa-f0-9]+\)>$") | ||
self.assertRegex(repr(c_wchar_p.from_param('hihi')), r"^<cparam 'Z' \(0x[A-Fa-f0-9]+\)>$") | ||
Uh oh!
There was an error while loading.Please reload this page.