[WIP] bpo-37409: Regression tests for builtins/importlib __import__ divergence#14465
[WIP] bpo-37409: Regression tests for builtins/importlib __import__ divergence#14465benjimin wants to merge 1 commit into
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
| @cpython_only | ||
| def test_import_shadowed_by_global(self): | ||
| # Regression test for https://bugs.python.org/issue37409 | ||
| assert subprocess.call([sys.executable, '-c', |
There was a problem hiding this comment.
Using test.support.script_helper.assert_python_ok seems like a better choice.
def test_import_shadowed_by_global(self):
with temp_dir() as path:
source = "foo = 'x'; from . import foo"
script = script_helper.make_script(path, "bar.py", source)
script_helper.assert_python_ok(script)|
@benjimin As this is marked as WIP and we try to keep such PRs out of our review queue I'm closing this for now until such time it's deemed ready for review. |
|
Ready for review now [bugfix commit], or should I open a different PR? |
|
@benjimin I can re-open this, but the title is still off. Once this PR is completely ready to go I can re-open it (or you can open a new one; up to you). |
https://bugs.python.org/issue37409
related:
https://bugs.python.org/issue37444
Presently these tests fail, need to fix
builtins.__import__to behave likeimportlib.__import__.https://bugs.python.org/issue37409