Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

was_called_with should treat named arguments as possible positional arguments #3

Description

@tsande01

e.g.

from pyne.test_doubles.expectations import expect
from pyne.pyne_test_collector import it
from pyne.pyne_tester import pyne
from pyne.test_doubles.spy import stub

@pyne
def _():
    @it("should match positional arguments when they are named explicitly")
    def _(self):
        class SomeClass():
            def some_method(self, arg1, arg2):
                pass

        instance = SomeClass()
        stub(instance, instance.some_method)
        instance.some_method("first-arg", arg2="second-arg")
        expect(instance.some_method).was_called_with(arg1="first-arg", arg2="second-arg")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions