Skip to content

Commit

Permalink
[mypyc] update, simplify check version test (#13125)
Browse files Browse the repository at this point in the history
Co-authored-by: hauntsaninja <>
  • Loading branch information
hauntsaninja authored Jul 15, 2022
1 parent 5b094d5 commit 4479e0c
Showing 1 changed file with 9 additions and 9 deletions.
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):
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

0 comments on commit 4479e0c

Please sign in to comment.