Skip to content

LineMatcher: add option to match all lines #6820

Description

@blueyed

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: pytesterrelated to the pytester builtin plugintype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions