kaste / mockito-python

Mockito is a spying framework
MIT License
123 stars 12 forks source link

Change Implementation for ArgumentCaptor to capture all invocations #44

Closed shashankrnr32 closed 2 years ago

shashankrnr32 commented 2 years ago

Fixes #41

Description

Change impl of ArgumentCaptor to capture all the invocations in an attribute called all_values.

Backward Compatibility

Not maintained with this change

Whats backward incompatible

  1. Previously value used to return None when the argument was not captured. After this change, the code will throw a MatcherError(RuntimeError)

New Attributes

  1. all_values: List of all the invocations captured by the ArgumentCaptor. If there are no invocations, the list is empty.
kaste commented 2 years ago

I like it a lot. Just want to sleep over it for a night.