Skip to content

Conversation

@bbayles
Copy link
Contributor

@bbayles bbayles commented Jul 21, 2018

The use of decimal.getcontext in test_time.py affects other modules that use the decimal module.

The PR changes the tests to use decimal.localcontext, which doesn't have this problem.

After

$ ./python -m test test_time test_statistics
Run tests sequentially
0:00:00 load avg: 2.53 [1/2] test_time
0:00:02 load avg: 2.53 [2/2] test_statistics

== Tests result: SUCCESS ==

All 2 tests OK.

Total duration: 3 sec 80 ms
Tests result: SUCCESS

Before

$ ./python -m test test_time test_statistics
Run tests sequentially
0:00:00 load avg: 2.54 [1/2] test_time
0:00:02 load avg: 2.66 [2/2] test_statistics
test test_statistics failed -- multiple errors occurred; run in verbose mode for details
test_statistics failed

== Tests result: FAILURE ==

1 test OK.

1 test failed:
    test_statistics

Total duration: 3 sec 87 ms
Tests result: FAILURE

https://bugs.python.org/issue34179

Copy link
Contributor

@skrah skrah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. In this case I would not make a NEWS entry, since the change does not affect users.

This reverts commit d1b6de7.
@bbayles
Copy link
Contributor Author

bbayles commented Jul 21, 2018

I've reverted the NEWS entry - I never know whether to add one. bedevere-bot immediately gives PRs a ❌ if there's not one, so I usually go ahead and do.

@skrah
Copy link
Contributor

skrah commented Jul 21, 2018

Yes, the bots aren't very flexible and NEWS entries somewhat subject to personal taste. I usually add one if I'd really want to be informed as a user, other people practically always add one.

@bedevere-bot
Copy link

@skrah: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

Thanks @bbayles for the PR, and @skrah for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 21, 2018
…honGH-8376)

(cherry picked from commit 938045f)

Co-authored-by: Bo Bayles <bbayles@gmail.com>
@bedevere-bot
Copy link

GH-8383 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 21, 2018
…honGH-8376)

(cherry picked from commit 938045f)

Co-authored-by: Bo Bayles <bbayles@gmail.com>
@bedevere-bot
Copy link

GH-8384 is a backport of this pull request to the 3.6 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip issue skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants