Adding a non regression test for #9765 #11725
Closed
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
conftestpath
althoughmod.__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_importconftest
once more with the original input like proposed in this PR.