kaste / mockito-python

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

Numpy arrays as when() arguments #28

Closed Chris-hughes10 closed 2 years ago

Chris-hughes10 commented 5 years ago

When using a numpy array as an argument to when() a value error is raised with the following message:

"ValueError: The truth value of an array with more than one element is ambiguous."

which is caused by the compare function in invocation.py.

It would be good to be able to pass array types to when(), which would be evaluated using .all() during comparison.

kaste commented 5 years ago

Hi!

There is a numpy testfile here https://github.com/kaste/mockito-python/blob/master/tests/numpy_test.py

Can you write a failing test for it to get it starting?

kaste commented 2 years ago

stranded