Commit ad56990c authored by Stefan Behnel's avatar Stefan Behnel

exclude incompatible tests under Py3

parent 3a99cd2b
...@@ -7,6 +7,7 @@ import codecs ...@@ -7,6 +7,7 @@ import codecs
import shutil import shutil
import unittest import unittest
import doctest import doctest
import operator
WITH_CYTHON = True WITH_CYTHON = True
...@@ -35,7 +36,10 @@ EXT_DEP_INCLUDES = [ ...@@ -35,7 +36,10 @@ EXT_DEP_INCLUDES = [
VER_DEP_MODULES = { VER_DEP_MODULES = {
# such as: # such as:
# (2,4) : lambda x: x in ['run.set'] # (2,4) : (operator.le, lambda x: x in ['run.set']),
(3,): (operator.ge, lambda x: x in ['run.non_future_division',
'run.extsetslice',
'run.extdelslice']),
} }
INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ] INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
...@@ -468,8 +472,8 @@ class VersionDependencyExcluder: ...@@ -468,8 +472,8 @@ class VersionDependencyExcluder:
# deps: { version : matcher func } # deps: { version : matcher func }
from sys import version_info from sys import version_info
self.exclude_matchers = [] self.exclude_matchers = []
for ver, matcher in deps.items(): for ver, (compare, matcher) in deps.items():
if version_info < ver: if compare(version_info, ver):
self.exclude_matchers.append(matcher) self.exclude_matchers.append(matcher)
self.tests_missing_deps = [] self.tests_missing_deps = []
def __call__(self, testname): def __call__(self, testname):
......
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