mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 23:21:22 -07:00
Disable code-smell tests on Python 2.6.
This commit is contained in:
parent
490edbdc48
commit
d758d5bab1
1 changed files with 8 additions and 0 deletions
|
@ -215,6 +215,10 @@ class SanityTest(ABC):
|
||||||
|
|
||||||
class SanityCodeSmellTest(SanityTest):
|
class SanityCodeSmellTest(SanityTest):
|
||||||
"""Sanity test script."""
|
"""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):
|
def __init__(self, path):
|
||||||
name = os.path.splitext(os.path.basename(path))[0]
|
name = os.path.splitext(os.path.basename(path))[0]
|
||||||
config_path = os.path.splitext(path)[0] + '.json'
|
config_path = os.path.splitext(path)[0] + '.json'
|
||||||
|
@ -238,6 +242,10 @@ class SanityCodeSmellTest(SanityTest):
|
||||||
:type targets: SanityTargets
|
:type targets: SanityTargets
|
||||||
:rtype: TestResult
|
: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'):
|
if self.path.endswith('.py'):
|
||||||
cmd = [args.python_executable, self.path]
|
cmd = [args.python_executable, self.path]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue