Skip to content

LineMatcher: add option to match all lines #6820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
blueyed opened this issue Feb 25, 2020 · 1 comment
Open

LineMatcher: add option to match all lines #6820

blueyed opened this issue Feb 25, 2020 · 1 comment
Labels
plugin: pytester related to the pytester builtin plugin type: enhancement new feature or API change, should be merged into features branch

Comments

@blueyed
Copy link
Contributor

blueyed commented Feb 25, 2020

In #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.

@blueyed blueyed added type: enhancement new feature or API change, should be merged into features branch plugin: pytester related to the pytester builtin plugin labels Feb 25, 2020
@blueyed
Copy link
Contributor Author

blueyed commented Feb 25, 2020

Given that LineMatcher does not really support setting lines on an existing instance this should also be turned into an object property maybe in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: pytester related to the pytester builtin plugin type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

1 participant