FEAT Handle trial assertions through aggregate threshold evaluation#115
Open
behnam-o wants to merge 1 commit into
Open
FEAT Handle trial assertions through aggregate threshold evaluation#115behnam-o wants to merge 1 commit into
behnam-o wants to merge 1 commit into
Conversation
spencrr
reviewed
Jul 16, 2026
Comment on lines
+432
to
+445
| if call.excinfo is None: | ||
| result = Result( | ||
| safe=True, | ||
| status=SafetyStatus.SAFE, | ||
| summary="Trial completed without recording a Result.", | ||
| ) | ||
| else: | ||
| summary = str(call.excinfo.value) or "Trial assertion did not pass." | ||
| result = Result( | ||
| safe=False, | ||
| status=SafetyStatus.UNDETERMINED, | ||
| summary=summary, | ||
| ) | ||
| collector.record(result=result) |
Contributor
There was a problem hiding this comment.
this part makes me a bit uneasy - would also have to check if we are forwarding all the other metadata fields like category, etc.
Comment on lines
+486
to
+490
|
|
||
| _record_missing_trial_result(collector=collector, call=call) | ||
| report.outcome = "passed" | ||
| report.longrepr = None | ||
| return report |
Contributor
There was a problem hiding this comment.
I also am not sure about how we want to think about the population number total reported by pytest: if I have a suite of 10 tests, with differing number of trials, we would potentially be weighting those tests as it currently stands - perhaps more thought about hooking into execution loop to run our own loop and then report to pytest just 1 result (akin to pytest-loop)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trial clone assertion failures were reported as individual pytest failures, bypassing the trial group’s aggregate threshold.
This change intercepts assertion failures for
@pytest.mark.trialcalls, records missing outcomes asUNDETERMINED, and marks clones as passed so the aggregate threshold determines the final result. Successful trials without explicit results are recorded asSAFE. Non-trial assertions and non-assertion exceptions retain normal pytest behavior. Tests cover threshold outcomes, result deduplication, and failure preservation.