Skip to content

Commit a242f19

Browse files
authored
Merge pull request #49 from devolo/fix_get_test_result
Fix ValueError in get_test_result
2 parents bf9f947 + 4f0129a commit a242f19

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.3.3] - 2023/09/12
8+
9+
### Fixed
10+
11+
- get_test_result does not raise in case there are no results
12+
713
## [2.3.2] - 2023/06/21
814

915
### Fixed

adaptavist/adaptavist.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -771,12 +771,10 @@ def get_test_result(self, test_run_key: str, test_case_key: str) -> Dict[str, An
771771
:returns: Test result
772772
"""
773773
response = self.get_test_results(test_run_key)
774-
return (
775-
max(
776-
(item for item in response if item["testCaseKey"] == test_case_key),
777-
key=lambda item: item["id"],
778-
)
779-
or {}
774+
return max(
775+
(item for item in response if item["testCaseKey"] == test_case_key),
776+
key=lambda item: item["id"],
777+
default={},
780778
)
781779

782780
def create_test_result(

0 commit comments

Comments
 (0)