From 0e13ab51d54a3d98d395b4c1215cfbd215c6368f Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Tue, 30 Jul 2024 15:45:44 -0700 Subject: [PATCH] AVX-55377: fix handling of insufficient JIRA configuration (#5) Signed-off-by: Steven Noonan --- pytest_testrail/plugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pytest_testrail/plugin.py b/pytest_testrail/plugin.py index 0fa7048..4872216 100644 --- a/pytest_testrail/plugin.py +++ b/pytest_testrail/plugin.py @@ -235,7 +235,7 @@ def set_github_env_var(self, var_name, var_value): else: logging.error("GITHUB_ENV environment variable is not set") - def get_client(self) -> jira.JIRA: + def get_jira_client(self) -> jira.JIRA: user = self.jira_username token = self.jira_token jira_client = None @@ -386,12 +386,12 @@ def handle_ci_notifications( def jira(self, outcome: str) -> str: try: - client = self.get_client() + client = self.get_jira_client() username = self.jira_owner testname = self.test_dirs regex = re.compile(r"[^a-zA-Z0-9_]+") # Expecting only letters and numbers - logger.info("username" + username) - logger.info("testname" + testname) + assert client is not None + assert username is not None self.issue_id = self.handle_ci_notifications( client, username, testname, outcome, self.github_commit_sha )