[WIP] docs: use sphinx-autodoc-typehints, minor typing improvements#6665
[WIP] docs: use sphinx-autodoc-typehints, minor typing improvements#6665blueyed wants to merge 3 commits intopytest-dev:masterfrom
Conversation
|
|
||
| @contextmanager | ||
| def _runtest_for_main(self, item, when): | ||
| def _runtest_for_main(self, item, when: str) -> Generator[None, None, None]: |
There was a problem hiding this comment.
@bluetech
item not typed because of catch_log_handler{,s} being set/unset there.
Ignoring any refactors I've wondered if a ItemWithLogging type would make sense in general, which would have that attribute allowed then? (I do not think it is worth it, was just wondering)
There was a problem hiding this comment.
Might work, but because the attribute is added and deleted, it can't be entirely correct, and would require casts as well, so probably doesn't make sense.
As for refactor, seems like a good case for an "item-level storage" mechanism #3740. Such storage could be typed in some appropriate manner, probably.
21c1987 to
0a8e8d3
Compare
|
Appears to not being able to handle the circular imports: (With and without |
bluetech
left a comment
There was a problem hiding this comment.
The type annotations LGTM.
I haven't looked into sphinx-autodoc-typehints, it sounds convenient though.
| :type mark_list: List[Union[Mark, Markdecorator]] | ||
| :rtype: List[Mark] | ||
| """ | ||
| def normalize_mark_list(mark_list: List[Union[Mark, MarkDecorator]]) -> List[Mark]: |
There was a problem hiding this comment.
mark_list can be Iterable (if you feel like it)
Ref: https://github.com/agronholm/sphinx-autodoc-typehints