Skip to content
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

Local scope imports error if using pytest hot reloader #128

Open
JamesHutchison opened this issue Apr 18, 2024 · 0 comments
Open

Local scope imports error if using pytest hot reloader #128

JamesHutchison opened this issue Apr 18, 2024 · 0 comments

Comments

@JamesHutchison
Copy link
Owner

When doing a local scope import

def my_func()
   from foo.bar import Moo

Using MegaPatch.it will error

MegaPatch.it(Moo)

This appears to be because the name is recorded by the import machinery as part of the module its imported in, but it doesn't actually show up in the namespace of the module, which creates the error. The likely solution to this problem is to have the import machinery ignore these imports.

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

No branches or pull requests

1 participant