mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 22:31:25 -07:00
Bug fixes and cleanup for ansible-test. (#45991)
* Remove unused imports. * Clean up ConfigParser usage in ansible-test. * Fix bare except statements in ansible-test. * Miscellaneous cleanup from PyCharm inspections. * Enable pylint no-self-use for ansible-test. * Remove obsolete pylint ignores for Python 3.7. * Fix shellcheck issuers under newer shellcheck. * Use newer path for ansible-test. * Fix issues in code-smell tests.
This commit is contained in:
parent
b60854357b
commit
ac492476e5
24 changed files with 36 additions and 128 deletions
|
@ -6,11 +6,6 @@ import json
|
|||
import os
|
||||
import datetime
|
||||
|
||||
try:
|
||||
import ConfigParser as configparser
|
||||
except ImportError:
|
||||
import configparser
|
||||
|
||||
from lib.sanity import (
|
||||
SanitySingleVersion,
|
||||
SanityMessage,
|
||||
|
@ -23,8 +18,8 @@ from lib.util import (
|
|||
SubprocessError,
|
||||
run_command,
|
||||
display,
|
||||
find_executable,
|
||||
read_lines_without_comments,
|
||||
ConfigParser,
|
||||
)
|
||||
|
||||
from lib.executor import (
|
||||
|
@ -245,7 +240,7 @@ class PylintTest(SanitySingleVersion):
|
|||
if not os.path.exists(rcfile):
|
||||
rcfile = 'test/sanity/pylint/config/default'
|
||||
|
||||
parser = configparser.SafeConfigParser()
|
||||
parser = ConfigParser()
|
||||
parser.read(rcfile)
|
||||
|
||||
if parser.has_section('ansible-test'):
|
||||
|
@ -268,7 +263,7 @@ class PylintTest(SanitySingleVersion):
|
|||
] + paths
|
||||
|
||||
env = ansible_environment(args)
|
||||
env['PYTHONPATH'] += '%s%s' % (os.pathsep, self.plugin_dir)
|
||||
env['PYTHONPATH'] += '%s%s' % (os.path.pathsep, self.plugin_dir)
|
||||
|
||||
if paths:
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue