Commit d6a1b54c authored by Jason Madden's avatar Jason Madden

Simplify test in test__execmodules. endswith can take a tuple, something I always forget.

parent 167d76b4
...@@ -60,10 +60,10 @@ PY35 = None ...@@ -60,10 +60,10 @@ PY35 = None
PY36 = None PY36 = None
PY37 = None PY37 = None
NON_APPLICABLE_SUFFIXES = [] NON_APPLICABLE_SUFFIXES = ()
if sys.version_info[0] == 3: if sys.version_info[0] == 3:
# Python 3 # Python 3
NON_APPLICABLE_SUFFIXES.extend(('2', '279')) NON_APPLICABLE_SUFFIXES += ('2', '279')
PY2 = False PY2 = False
PY3 = True PY3 = True
if sys.version_info[1] >= 4: if sys.version_info[1] >= 4:
...@@ -79,11 +79,11 @@ elif sys.version_info[0] == 2: ...@@ -79,11 +79,11 @@ elif sys.version_info[0] == 2:
# Any python 2 # Any python 2
PY3 = False PY3 = False
PY2 = True PY2 = True
NON_APPLICABLE_SUFFIXES.append('3') NON_APPLICABLE_SUFFIXES += ('3',)
if (sys.version_info[1] < 7 if (sys.version_info[1] < 7
or (sys.version_info[1] == 7 and sys.version_info[2] < 9)): or (sys.version_info[1] == 7 and sys.version_info[2] < 9)):
# Python 2, < 2.7.9 # Python 2, < 2.7.9
NON_APPLICABLE_SUFFIXES.append('279') NON_APPLICABLE_SUFFIXES += ('279',)
PYPY3 = PYPY and PY3 PYPY3 = PYPY and PY3
...@@ -96,9 +96,9 @@ PYGTE279 = ( ...@@ -96,9 +96,9 @@ PYGTE279 = (
) )
if WIN: if WIN:
NON_APPLICABLE_SUFFIXES.append("posix") NON_APPLICABLE_SUFFIXES += ("posix",)
# This is intimately tied to FileObjectPosix # This is intimately tied to FileObjectPosix
NON_APPLICABLE_SUFFIXES.append("fileobject2") NON_APPLICABLE_SUFFIXES += ("fileobject2",)
SHARED_OBJECT_EXTENSION = ".pyd" SHARED_OBJECT_EXTENSION = ".pyd"
else: else:
SHARED_OBJECT_EXTENSION = ".so" SHARED_OBJECT_EXTENSION = ".so"
...@@ -111,7 +111,7 @@ RUNNING_ON_CI = RUNNING_ON_TRAVIS or RUNNING_ON_APPVEYOR ...@@ -111,7 +111,7 @@ RUNNING_ON_CI = RUNNING_ON_TRAVIS or RUNNING_ON_APPVEYOR
if RUNNING_ON_APPVEYOR: if RUNNING_ON_APPVEYOR:
# We can't exec corecext on appveyor if we haven't run setup.py in # We can't exec corecext on appveyor if we haven't run setup.py in
# 'develop' mode (i.e., we install) # 'develop' mode (i.e., we install)
NON_APPLICABLE_SUFFIXES.append('corecext') NON_APPLICABLE_SUFFIXES += ('corecext',)
EXPECT_POOR_TIMER_RESOLUTION = (PYPY3 EXPECT_POOR_TIMER_RESOLUTION = (PYPY3
or RUNNING_ON_APPVEYOR or RUNNING_ON_APPVEYOR
......
...@@ -26,14 +26,8 @@ def make_exec_test(path, module): ...@@ -26,14 +26,8 @@ def make_exec_test(path, module):
def make_all_tests(): def make_all_tests():
for path, module in walk_modules(): for path, module in walk_modules():
ignored = False if module.endswith(NON_APPLICABLE_SUFFIXES):
for x in NON_APPLICABLE_SUFFIXES:
if module.endswith(x):
ignored = True
break
if ignored:
continue continue
make_exec_test(path, module) make_exec_test(path, module)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment