-
Notifications
You must be signed in to change notification settings - Fork 1
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
[WIP] Investigating/fixing capsysbin #277
Conversation
src/_pytest/capture.py
Outdated
# Would be good to ensure out and err are of the same type. | ||
class CaptureResult(NamedTuple): | ||
out: Union[str, bytes] | ||
err: Union[str, bytes] |
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.
@bluetech
Can this be done with Generic[AnyStr]
to couple types of out/err?
As far as I know `pre-commit` does not have a switch to skip/exclude a "hook", and it should not cause CI to fail - flake8 is enough for this. Ref: pytest-dev#6877
@@ -439,7 +440,11 @@ def __getattr__(self, name): | |||
return getattr(object.__getattribute__(self, "buffer"), name) | |||
|
|||
|
|||
CaptureResult = collections.namedtuple("CaptureResult", ["out", "err"]) | |||
# XXX: Generic[AnyStr], and AnyStr as type directly does not work? |
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.
Seems like mypy doesn't support generic namedtuples yet: python/mypy#685
Fix in 9e5a830, typing not feasible (yet). |
Ref: pytest-dev#6871