From d758d5bab12aa57440555f02a51d77222b59d81f Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 4 Jun 2019 22:08:18 -0700 Subject: [PATCH] Disable code-smell tests on Python 2.6. --- test/runner/lib/sanity/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/runner/lib/sanity/__init__.py b/test/runner/lib/sanity/__init__.py index 8710201a799..420eb7e1ee6 100644 --- a/test/runner/lib/sanity/__init__.py +++ b/test/runner/lib/sanity/__init__.py @@ -215,6 +215,10 @@ class SanityTest(ABC): class SanityCodeSmellTest(SanityTest): """Sanity test script.""" + UNSUPPORTED_PYTHON_VERSIONS = ( + '2.6', # some tests use voluptuous, but the version we require does not support python 2.6 + ) + def __init__(self, path): name = os.path.splitext(os.path.basename(path))[0] config_path = os.path.splitext(path)[0] + '.json' @@ -238,6 +242,10 @@ class SanityCodeSmellTest(SanityTest): :type targets: SanityTargets :rtype: TestResult """ + if args.python_version in self.UNSUPPORTED_PYTHON_VERSIONS: + display.warning('Skipping %s on unsupported Python version %s.' % (self.name, args.python_version)) + return SanitySkipped(self.name) + if self.path.endswith('.py'): cmd = [args.python_executable, self.path] else: