From 4479e0c2a75b7b802adf628034fa83beee9572c1 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Fri, 15 Jul 2022 12:57:11 -0700 Subject: [PATCH] [mypyc] update, simplify check version test (#13125) Co-authored-by: hauntsaninja <> --- mypyc/test-data/run-misc.test | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mypyc/test-data/run-misc.test b/mypyc/test-data/run-misc.test index 736169f95b82..66b00b25089d 100644 --- a/mypyc/test-data/run-misc.test +++ b/mypyc/test-data/run-misc.test @@ -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): @@ -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