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

[WIP] Investigating/fixing capsysbin #277

Closed
wants to merge 4 commits into from
Closed

Conversation

blueyed
Copy link
Owner

@blueyed blueyed commented Mar 8, 2020

# Would be good to ensure out and err are of the same type.
class CaptureResult(NamedTuple):
out: Union[str, bytes]
err: Union[str, bytes]
Copy link
Owner Author

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?
Copy link

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

@blueyed
Copy link
Owner Author

blueyed commented Mar 12, 2020

Fix in 9e5a830, typing not feasible (yet).

@blueyed blueyed closed this Mar 12, 2020
@blueyed blueyed deleted the capture-capsysbin branch March 12, 2020 11:05
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.

None yet

2 participants