pytest-dev / pytest-dev/pytest
LineMatcher: add option to match all lines
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
In https://github.com/pytest-dev/pytest/pull/6653 consecutive was added, which allows to ensure that the subset of lines is matched consecutively.
However, it would also be useful to have a mode that ensures that all expected
lines are in the output, e.g. complete=True: LineMatcher(["unexpected", "1", "2", "3"]).fnmatch_lines(["1", "2", "3"],
complete=True) should fail then (since "unexpected" was not asserted).
Given that consecutive has not been released and that it overlaps (since complete would imply consecutive) it might be worth to change this into a more generic mode argument.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the LineMatcher.fnmatch_lines entry point and review the existing consecutive behavior introduced by pull request #6653. Decide how a complete or more generic mode should cover all expected lines, then verify that the example with an unexpected line fails and add regression coverage for the selected API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100