8000 Added support for platform.system() by joybh98 · Pull Request #8461 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Added support for platform.system() #8461

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

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added test
  • Loading branch information
joybh98 committed Mar 5, 2020
commit 0794d77dcf6dbdefd32f874b5b4b2d2b20edaad3
2 changes: 2 additions & 0 deletions test-data/unit/check-unreachable-code.test
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ else:
import sys
if sys.platform == 'fictional':
def foo() -> int: return 0
if platform.system():
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if platform.system():
if platform.system() == 'fake':

I think this test should test comparison.

def foo() -> int: return 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

There should also be a test that has a successful platform check.

Also test that --platform affects a platform.system() check.

else:
def foo() -> str: return ''
foo() + ''
Expand Down
0