Skip to content

[mypyc] simplify check version test, update for py311 #13125

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

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Changes from all commits
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
18 changes: 9 additions & 9 deletions mypyc/test-data/run-misc.test
Original file line number Diff line number Diff line change
Expand Up @@ -972,9 +972,13 @@ print(z)
[case testCheckVersion]
import sys

# We lie about the version we are running in tests if it is 3.5, so
# that hits a crash case.
if sys.version_info[:2] == (3, 10):
if sys.version_info[:2] == (3, 12):
Copy link
Member

Choose a reason for hiding this comment

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

lol, whoever adds support for 3.13 will like you

def version() -> int:
return 12
elif sys.version_info[:2] == (3, 11):
def version() -> int:
return 11
elif sys.version_info[:2] == (3, 10):
def version() -> int:
return 10
elif sys.version_info[:2] == (3, 9):
Expand All @@ -997,12 +1001,8 @@ else:
import sys
version = sys.version_info[:2]

try:
import native
assert version != (3, 5), "3.5 should fail!"
assert native.version() == sys.version_info[1]
except RuntimeError:
assert version == (3, 5), "only 3.5 should fail!"
import native
assert native.version() == sys.version_info[1]

[case testTypeErrorMessages]
from typing import Tuple
Expand Down