-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-40058: Fix failed test_divide_and_round of test_datetime when run more than … #19213
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I tested manually that this change fix https://bugs.python.org/issue40058
@pganssle: Do you want to double check? Or can I merge the change?
@vstinner @shihai1991 I don't think we can rely on "the tests pass" or "the problem in bpo-40058 is fixed" to determine whether or not this is a good change, because you're removing code that is designed to ensure that The other
I think the questions to answer before we can remove this (per Chesterton's Fence) are:
|
To be honest, I don't know the purpose of clean state of sys.modules :( |
import_fresh_module() saves/restores datetime, _datetime and _strptime modules of sys.modules. I don't understand what do you mean by "clean state"? The PR removes:
I expect that import_fresh_module() works as expected. If it's not the case, it should be fixed. But test_datetime must not workaround bugs, if there are bugs. |
@vstinner I agree that the final solution to this problem should be to fix the underlying problem and remove the workarounds, but we can't remove the workarounds until we know what they are working around - that is essentially tantamount to breaking the tests - and what's worse, we don't even know how we're breaking them - the tests still pass, but they may be testing something other than they are expected to test. Again this is a perfect Chesterton's Fence situation: I am eager to remove the "fence", but only once I know why it's here. |
Hm, I should know the Historical reason:
so it increased 6 modules in |
victor's #20472 will fix this bug, so I close this PR. |
I think #20472 incidentally fixes this issue. If anyone can figure out why this stuff was added in the first place, there still might be good reason to remove it. TBH, there might be even more reason to remove it after #20472, because the |
https://bugs.python.org/issue40058