diff --git a/CHANGELOG.md b/CHANGELOG.md index e5f7699..c951ee3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +### Fixed +- Agent crash if Client could not be initialized, by @HardNorth ### Changed - Client version updated on [5.5.10](https://github.com/reportportal/client-Python/releases/tag/5.5.10), by @HardNorth diff --git a/pytest_reportportal/service.py b/pytest_reportportal/service.py index 7cda5f0..c47dc4d 100644 --- a/pytest_reportportal/service.py +++ b/pytest_reportportal/service.py @@ -167,6 +167,8 @@ def issue_types(self) -> Dict[str, str]: project_settings = self.project_settings if not isinstance(self.project_settings, dict): project_settings = project_settings.blocking_result() + if not project_settings: + return self._issue_types for values in project_settings["subTypes"].values(): for item in values: self._issue_types[item["shortName"]] = item["locator"] @@ -864,6 +866,10 @@ def report_fixture(self, name: str, error_msg: str) -> None: :param name: Name of the fixture :param error_msg: Error message """ + if not self.rp: + yield + return + reporter = self.rp.step_reporter item_id = reporter.start_nested_step(name, timestamp()) @@ -874,6 +880,7 @@ def report_fixture(self, name: str, error_msg: str) -> None: if exception: if type(exception).__name__ != 'Skipped': status = 'FAILED' + self.post_log(name, error_msg, log_level='ERROR') reporter.finish_nested_step(item_id, timestamp(), status) except Exception as e: LOGGER.error('Failed to report fixture: %s', name)