Skip to content

[WIP] bpo-37409: Regression tests for builtins/importlib __import__ divergence #14465

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

Closed
wants to merge 1 commit into from

Conversation

benjimin
Copy link
Contributor

@benjimin benjimin commented Jun 29, 2019

https://bugs.python.org/issue37409

related:
https://bugs.python.org/issue37444

Presently these tests fail, need to fix builtins.__import__ to behave like importlib.__import__.

https://bugs.python.org/issue37409

@the-knights-who-say-ni
Copy link

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
before our records are updated.

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',
Copy link
Member

Choose a reason for hiding this comment

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

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)

@brettcannon
Copy link
Member

@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.

@benjimin
Copy link
Contributor Author

Ready for review now [bugfix commit], or should I open a different PR?

@brettcannon
Copy link
Member

@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).

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

Successfully merging this pull request may close these issues.

5 participants