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

Type-hinting for looping over the xml children #137

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Cube707
Copy link

@Cube707 Cube707 commented Oct 10, 2024

Previously for suite in xml and for case in suite would not detect the proper types for suite and case and not give intelisense.

this fixes the elements being detected as type Any and instead the proper type is detected, enableing auto-completeion.

Checking for `None` should be done explicitly and not by relying on the falsienes of it.
This is faster and avoids problems if falsy objects are passed in as an argument.
@leon1995
Copy link

Thanks for your work! I am also looking forward to this. Could this be merged soon please? @weiwei

Copy link
Collaborator

@EnricoMi EnricoMi left a comment

Choose a reason for hiding this comment

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

We could also annotate __iter__ methods of Properties and TestCase. The latter would return Iterator[Union[Result, System]].

this fixes the elements being detected as type `Any` and users not getting intellisense
@Cube707
Copy link
Author

Cube707 commented Dec 20, 2024

We could also annotate __iter__ methods of Properties and TestCase. The latter would return Iterator[Union[Result, System]].

A also added it in xunit2.py

@Cube707 Cube707 requested a review from EnricoMi December 20, 2024 15:08
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.

3 participants