From f430ee4d9ef63f104dde63710fce7f8fa3c61591 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 29 Sep 2023 14:12:18 +0200 Subject: Upgrade pylint and fix latest warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8b9e4b663a12ac9be18fded2d7b4e4b38428fa9f Signed-off-by: Cédric Ollivier --- xtesting/core/campaign.py | 3 ++- xtesting/core/testcase.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'xtesting/core') diff --git a/xtesting/core/campaign.py b/xtesting/core/campaign.py index 901df587..98b2f1a8 100644 --- a/xtesting/core/campaign.py +++ b/xtesting/core/campaign.py @@ -70,7 +70,8 @@ class Campaign(): url = env.get('TEST_DB_URL') req = requests.get( f"{url}?build_tag={env.get('BUILD_TAG')}", - headers=testcase.TestCase.headers) + headers=testcase.TestCase.headers, + timeout=10) req.raise_for_status() output = req.json() Campaign.__logger.debug("data from DB: \n%s", output) diff --git a/xtesting/core/testcase.py b/xtesting/core/testcase.py index b44ed793..380adc5e 100644 --- a/xtesting/core/testcase.py +++ b/xtesting/core/testcase.py @@ -149,7 +149,7 @@ class TestCase(metaclass=abc.ABCMeta): self.__logger.error("Please run test before checking the results") return TestCase.EX_TESTCASE_FAILED - def check_requirements(self): # pylint: disable=no-self-use + def check_requirements(self): """Check the requirements of the test case. It can be overriden on purpose. @@ -235,7 +235,8 @@ class TestCase(metaclass=abc.ABCMeta): data["version"] = "unknown" req = requests.post( url, data=json.dumps(data, sort_keys=True), - headers=self.headers) + headers=self.headers, + timeout=10) req.raise_for_status() if urlparse(url).scheme != "file": # href must be postprocessed as OPNFV testapi is misconfigured -- cgit 1.2.3-korg