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
Fix ansible-test relative import analysis. #70973
Conversation
cc @tremble |
# This assumes that all files within the collection are executed by Ansible as part of the collection. | ||
# While that will usually be true, there are exceptions which will result in this resolution being incorrect. | ||
self.module = path_to_module(os.path.join(data_context().content.collection.directory, self.path)) | ||
|
||
# noinspection PyPep8Naming | ||
# pylint: disable=locally-disabled, invalid-name | ||
def visit_Import(self, node): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dumb question: should visit_Import be updated too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the from ... import
statement supports relative imports, so there's nothing to do for the import
statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth I've tested this locally and it appears to be working as expected...
SUMMARY
Fix ansible-test relative import analysis.
Replaces #70866
Resolves ansible-collections/amazon.aws#110
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
ansible-test