Skip to content

verifyNoUnwantedInteractions is named poorly #94

@kaste

Description

@kaste

See https://stackoverflow.com/questions/53742022/how-to-properly-use-verifynounwantedinteractions-in-python-mockito/54346862

verifyNoUnwantedInteractions only works when the user used expect. Clearly better candidates are verifyExpectations or the more verbose verifyExpectationsAreMet. That at least indicates that a when might not be enough.

(However, setting up a when (patch) indicates that you also use it, otherwise why would you set it up? For which we have verifyStubbedInvocationsAreUsed explicitly. Maybe rename that to the shorter verifyStubsAreUsed and also check if the mock is used at all, i.e. if len(theMock.invocations) > 0 which would be the inverse of verifyZeroInteractions?) Scratch the latter, stubs or mocks can used just by passing them around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions