Skip to content

Allow partial match of arguments #140

@charlax

Description

@charlax

It would be nice to be able to check for partial argument match. The equals library will still require you to provide all arguments:

import equals

import a


# Code under test
def stuff_to_test():
    return a.func(a="a", b="b", c="c")


# Test
def test_stuff():
    # Even if you only care about the last arg, you need to provide all of them
    allow(a).func(a=equals.any_string, b=equals.any_string, c="c").and_return("c")

    # It would be nice to be able to so something like that:
    allow(a, partial_match=True).func(c="c").and_return("c")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions