Skip to content

platform-dependent testing.CaptureMode type alias#3452

Open
jorenham wants to merge 1 commit into
pallets:mainfrom
jorenham:typing/testing/platform-dependent-CaptureMode
Open

platform-dependent testing.CaptureMode type alias#3452
jorenham wants to merge 1 commit into
pallets:mainfrom
jorenham:typing/testing/platform-dependent-CaptureMode

Conversation

@jorenham
Copy link
Copy Markdown
Contributor

CliRunner.__init__ will raise a ValueError if capture="fd" on windows. By using the fact that type-checkers are able to understand basic sys.platform checks (https://typing.python.org/en/latest/spec/directives.html#version-and-platform-checking), we can use Python's type system to prevent this from happening, by having a definition for the CaptureMode type alias on windows, improving type-safety.

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.

1 participant