Adding a non regression test for #9765#11725
Closed
fcharras wants to merge 4 commits intopytest-dev:mainfrom
Closed
Adding a non regression test for #9765#11725fcharras wants to merge 4 commits intopytest-dev:mainfrom
fcharras wants to merge 4 commits intopytest-dev:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Non regression test for #9765
The test is expected to fail here, and to be fixed in #11708 .
Note that the test does not reproduce directly the cause of #9765 but is a best effort at reproducing the mechanism. In #9765 we were surprised of the formatting of
mod.__file__because it differs fromstr(conftestpath)althoughstr(conftestpath)has not been altered.Here we trigger an issue by submitting an altered
conftestpathalthoughmod.__file__most likely would have the expected value. It does not reproduce the crash linked to double loading, but instead highlights that modules that should have been the same are in fact different.I haven't found any documentation or PEP that says how
mod.__file__can be expected to be formatted, so in fact we could expect it to have any weird formatting as long as it resolves tostr(conftestpath)so I think it is correct to run_importconftestonce more with the original input like proposed in this PR.