Skip to content

Commit

Permalink
Addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mtache committed Jan 7, 2025
1 parent b7eed9e commit 76a9a86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions anta/result_manager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,19 @@ class AtomicTestResult(BaseTestResult):

def __init__(self, **data: Any) -> None: # noqa: ANN401
"""Instantiate the parent TestResult private attribute."""
if "parent" not in data:
msg = "An AtomicTestResult instance must have a parent."
raise RuntimeError(msg)
parent = data.pop("parent")
super().__init__(**data)
self._parent = parent

def _set_status(self, status: AntaTestStatus, message: str | None = None) -> None:
"""Set status and insert optional message.
If the parent TestResult status is UNSET and this AtomicTestResult status is SUCCESS, the parent TestResult status will be set as a SUCCESS.
If this AtomicTestResult status is FAILURE or ERROR, the parent TestResult status will be set with the same status.
Parameters
----------
status
Expand Down

0 comments on commit 76a9a86

Please sign in to comment.