Skip to content

Commit

Permalink
Linters fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wwakabobik committed Sep 14, 2023
1 parent 120a7ae commit 2ac8441
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions testrail_api_reporter/engines/results_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def __init__(
print("\nTestrail Api Reporter init")
if url is None or email is None or password is None:
raise ValueError("No TestRails credentials are provided!")
else:
self.__api = TestRailAPI(url, email, password)
self.__api = TestRailAPI(url, email, password)
self.__xml_report = xml_report if self.__check_report_exists(xml_report=xml_report) else None
self.__project_id = project_id if self.__check_project(project_id=project_id) else None
self.__suite_id = suite_id if self.__check_suite(suite_id=suite_id) else None
Expand Down Expand Up @@ -128,7 +127,8 @@ def __ensure_automation_section(self, title="pytest", debug=None):
self.__self_check()
return None
first_run = False
elif response is not None and response["_links"]["next"] is not None:
# pylint: disable=E1136
elif response["_links"]["next"] is not None:
offset = int(response["_links"]["next"].split("&offset=")[1].split("&")[0])
response = self.__api.sections.get_sections(
project_id=self.__project_id, suite_id=self.__suite_id, offset=offset
Expand Down Expand Up @@ -234,7 +234,8 @@ def __get_all_auto_cases(self, retries=3, debug=None):
return None
first_run = False
retry = 0
elif response is not None and response["_links"]["next"] is not None:
# pylint: disable=E1136
elif response["_links"]["next"] is not None:
offset = int(response["_links"]["next"].split("&offset=")[1].split("&")[0])
try:
response = self.__api.cases.get_cases(
Expand Down Expand Up @@ -483,7 +484,8 @@ def __search_for_run_by_name(self, title=None):
print(f"Can't get run list. Something nasty happened.\nError{format_error(error)}")
break
first_run = False
elif response is not None and response["_links"]["next"] is not None:
# pylint: disable=E1136
elif response["_links"]["next"] is not None:
offset = int(response["_links"]["next"].split("&offset=")[1].split("&")[0])
response = self.__api.runs.get_runs(
project_id=self.__project_id, suite_id=self.__suite_id, offset=offset
Expand Down

0 comments on commit 2ac8441

Please sign in to comment.