-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Failed separate test_from_tuple in test_decimal #77931
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
Comments
$ ./python -m test -v -m test_from_tuple test_decimal
...
test_from_tuple (test.test_decimal.CWhitebox) ... FAIL ====================================================================== Traceback (most recent call last):
File "/home/serhiy/py/cpython/Lib/test/test_decimal.py", line 5413, in test_from_tuple
self.assertEqual(str(c.create_decimal(x)), '-0E-1000026')
AssertionError: '-0E-1000007' != '-0E-1000026'
- -0E-1000007
? ^^
+ -0E-1000026
? ^^ |
I think the tests are order-dependent in multiple places. Personally, I don't see much value in fixing that because it has little effect on the actual code. |
Doesn't this mean that the test is incorrect? It expects the result be '-0E-1000026', but actually it should be '-0E-1000007', and it is '-0E-1000026' only after performing some actions outside of the test. Or maybe that there is a leak of the state out of localcontext? |
The test is insignificant. The real tests are mpdecimal-testit- 2.4.1.tar.gz (http://www.bytereef.org/mpdecimal/download.html), deccheck.py and my private python test suite. This test uses the global context that has been modified somewhere. I think I added that test to increase code coverage. |
The thread local context was modified in test_round(), so prec=28 was used in test_from_tuple() when running the whole test suite but prec=9 when running the single test. I don't really consider that a bug, but it is easy to "fix". I wouldn't be surprised if other similar cases exist. |
I ran all tests separately and this was the only case. PR 7355 fixes it. There are no other failures, errors or warnings.
|
OK, thanks for checking the other tests! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: