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

Avoid generating empty ImportFrom statements #337

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mjpieters
Copy link

  • When emitting a ImportFrom() node, assert that the list of names is not empty, and address all places where this potentially could happen.
  • Extend the input_types_generator/test_filtering_names test to include at least 1 enum so that it would trigger the assertion error if that enum is not included in the used inputs.

Fixes #308

- When emitting a `ImportFrom()` node, assert that the list of names
  is not empty, and address all places where this potentially could
  happen.
- Extend the `input_types_generator/test_filtering_names` test to
  include at least 1 enum so that it would trigger the assertion error
  if that enum is not included in the used inputs.
@mjpieters
Copy link
Author

Note that I expect there to be a few test failures until #334 and #335 have been addressed. I have a PR up for the second issue.

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

Successfully merging this pull request may close these issues.

include_all_inputs = false leads to IndexError in isort
1 participant