@@ -51,6 +51,14 @@ def check_tests_valid(testFile):
5151 check_async_test_function (item )
5252
5353
54+ def check_tests_valid_after_version (testFile , version ):
55+
56+ if sys .version_info [:2 ] >= version :
57+ print ("INFO: Will run tests in" , testFile , "since we're running Python" , version , "or newer" )
58+ check_tests_valid (testFile )
59+ else :
60+ print ("WARN: Will not run tests in" , testFile , "since we're running Python" , sys .version_info [:2 ], "and need" , version , "or newer" )
61+
5462if __name__ == "__main__" :
5563 check_tests_valid ("coverage.classes" )
5664 check_tests_valid ("coverage.test" )
@@ -60,12 +68,9 @@ def check_tests_valid(testFile):
6068 check_tests_valid ("variable-capture.dict" )
6169 check_tests_valid ("module-initialization.multiphase" )
6270 check_tests_valid ("fieldflow.test" )
63-
64- if sys .version_info [:2 ] >= (3 , 10 ):
65- print ("INFO: Will run `match` tests since we're running Python 3.10 or newer" )
66- check_tests_valid ("match.test" )
67- else :
68- print ("WARN: Skipping `match` tests since we're not running 3.10 or newer" )
71+ check_tests_valid_after_version ("match.test" , (3 , 10 ))
72+ check_tests_valid ("exceptions.test" )
73+ check_tests_valid_after_version ("exceptions.test_group" , (3 , 11 ))
6974
7075 # The below fails when trying to import modules
7176 # check_tests_valid("module-initialization.test")
0 commit comments