Skip to content

feat: list[str] + case-insensitive support for assert_final_output(contains=...)#4

Open
Neohu-ceo wants to merge 1 commit into
simukappu:mainfrom
Neohu-ceo:fix/contains-list-ci
Open

feat: list[str] + case-insensitive support for assert_final_output(contains=...)#4
Neohu-ceo wants to merge 1 commit into
simukappu:mainfrom
Neohu-ceo:fix/contains-list-ci

Conversation

@Neohu-ceo

Copy link
Copy Markdown

Summary

Extends assert_final_output(contains=...) with backward-compatible features (fixes #2):

  1. list[str]contains now accepts a list; all substrings must match
  2. case_sensitive=False — case-insensitive substring matching

Examples

# All substrings must be present
assert_final_output(result, contains=["Tokyo", "22°C"])

# Case-insensitive
assert_final_output(result, contains="tokyo", case_sensitive=False)

equals and matches unchanged. Default case_sensitive=True — existing tests unaffected.

@simukappu

Copy link
Copy Markdown
Owner

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!

@simukappu simukappu added the enhancement New feature or request label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Case-insensitive and multi-substring matching for assert_final_output(contains=...)

2 participants