diff --git a/CHANGELOG.md b/CHANGELOG.md index 88b1fe1..4d38337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ # Changelog ## [Unreleased] +### Fixed +- Issue [#375](https://github.com/reportportal/agent-python-pytest/issues/375): Fix max Item name length, by @HardNorth ### Added -Issue [#332](https://github.com/reportportal/agent-python-pytest/issues/332): Support for fixture reporting, by @HardNorth +- Issue [#332](https://github.com/reportportal/agent-python-pytest/issues/332): Support for fixture reporting, by @HardNorth ## [5.4.2] ### Fixed diff --git a/pytest_reportportal/service.py b/pytest_reportportal/service.py index da81388..12905c5 100644 --- a/pytest_reportportal/service.py +++ b/pytest_reportportal/service.py @@ -358,21 +358,16 @@ def collect_tests(self, session: Session) -> None: self._merge_code(test_tree) self._build_item_paths(test_tree, []) - def _get_item_name(self, name): + def _get_item_name(self, name: str) -> str: """Get name of item. - :param name: Item name - :return: name + :param name: Test Item name + :return: truncated to maximum length name if needed """ if len(name) > MAX_ITEM_NAME_LENGTH: - name = name[:MAX_ITEM_NAME_LENGTH - len(TRUNCATION_STR)] + \ - TRUNCATION_STR - log.warning( - PytestWarning( - 'Test leaf ID was truncated to "{}" because of name size ' - 'constrains on Report Portal'.format(name) - ) - ) + name = name[:MAX_ITEM_NAME_LENGTH - len(TRUNCATION_STR)] + TRUNCATION_STR + log.warning(PytestWarning( + f'Test leaf ID was truncated to "{name}" because of name size constrains on Report Portal')) return name def _get_item_description(self, test_item):