Update cgts-client testenv to use python3 by default

Change testenv and pylint testenv from python2.7 to python3.
Change installed version of pylint for tests to be the same as the
ones used in sysinv. Previously no version was pinned.
Add inline pylint warning suppressions.

Story: 2008454
Task: 42617
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Change-Id: I76b066b0e9bc3614f4819f113e44d29435c5a852
This commit is contained in:
Dan Voiculeasa 2021-06-18 13:11:50 +03:00
parent 0bf05fafc7
commit fee9bf0cbd
5 changed files with 11 additions and 9 deletions

View File

@ -238,7 +238,7 @@ class HTTPClient(httplib2.Http):
error_json = self._extract_error_json(body_str)
raise exceptions.Forbidden(error_json.get('faultstring'))
elif 400 <= status_code < 600:
_logger.warn("Request returned failure status.")
_logger.warn("Request returned failure status.") # pylint: disable=deprecated-method
error_json = self._extract_error_json(body_str)
raise exceptions.from_response(
resp, error_json.get('faultstring'),

View File

@ -158,17 +158,17 @@ def from_response(response, message=None, traceback=None,
class NoTokenLookupException(Exception):
"""DEPRECATED."""
pass
pass # pylint: disable=unnecessary-pass
class EndpointNotFound(Exception):
"""DEPRECATED."""
pass
pass # pylint: disable=unnecessary-pass
class AmbiguousAuthSystem(ClientException):
"""Could not obtain token and endpoint using provided credentials."""
pass
pass # pylint: disable=unnecessary-pass
class CgtsclientException(Exception):
@ -206,7 +206,7 @@ class CgtsclientException(Exception):
def format_message(self):
if self.__class__.__name__.endswith('_Remote'):
return self.args[0]
return self.args[0] # pylint: disable=unsubscriptable-object
else:
return six.text_type(self)

View File

@ -255,10 +255,10 @@ class CgtsShell(object):
args = subcommand_parser.parse_args(argv)
# Short-circuit and deal with help command right away.
if args.func == self.do_help:
if args.func == self.do_help: # pylint: disable=comparison-with-callable
self.do_help(args)
return 0
elif args.func == self.do_bash_completion:
elif args.func == self.do_bash_completion: # pylint: disable=comparison-with-callable
self.do_bash_completion(args)
return 0

View File

@ -17,3 +17,5 @@ testtools>=1.4.0 # MIT
testresources>=0.2.4 # Apache-2.0/BSD
httplib2
python-keystoneclient
pylint<2.1.0;python_version<"3.0" # GPLv2
pylint<2.4.0;python_version>="3.0" # GPLv2

View File

@ -13,7 +13,7 @@ setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_TEST_PATH=cgtsclient/tests
TESTR_START_DIR=cgtsclient/tests
basepython = python2.7
basepython = python3
usedevelop = True
install_command = pip install \
-U \
@ -105,7 +105,7 @@ ignore = H102,H104,H105,H238,H404,H405,
F841
[testenv:pylint]
basepython = python2.7
basepython = python3
deps = {[testenv]deps}
pylint