You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: list[str] + case-insensitive support for assert_final_output(contains=...) - #4
# All substrings must be presentassert_final_output(result, contains=["Tokyo", "22°C"])
# Case-insensitiveassert_final_output(result, contains="tokyo", case_sensitive=False)
equals and matches unchanged. Default case_sensitive=True — existing tests unaffected.
Thanks for the PR, and for picking up a good first issue! The implementation looks correct and is backward-compatible. Single-string input with the default case_sensitive=True keeps the existing behavior and error message.
CI is failing on the coverage check, which points at the missing tests. The new branches (the case_sensitive path and the missing / single-vs-multiple formatting) aren't exercised yet. Could you add tests under tests/test_assertions.py covering: single string (existing), list with all present, list with one missing, case-insensitive hit, and case-insensitive miss? Once those are in and CI is green, this is good to merge.
No need to touch the CHANGELOG. I'll handle that on the maintainer side. Thanks again!
Thanks for the contribution, and sorry for the long wait. I've merged your commit into develop as-is and added a follow-up with the tests from #2, a ValueError for an empty contains, case-insensitive matching via str.casefold(), and README docs. case_sensitive stays scoped to contains, as #2 specifies. It will ship in 0.5.0, and this PR will close automatically when main is updated at release.
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
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.
Summary
Extends
assert_final_output(contains=...)with backward-compatible features (fixes #2):containsnow accepts a list; all substrings must matchExamples
equalsandmatchesunchanged. Defaultcase_sensitive=True— existing tests unaffected.