Valeriu Predoi <valeriu.pre...@gmail.com> added the comment:

Hello mate, yes it used to work fine with Python 3.8, no issue with Python 3.9 
and numpy if you call mock as 

ob = mg.Mock(spec=np.array([4, 4]))

this results in a nice exception being raised:

Traceback (most recent call last):
  File "/home/valeriu/ESMValCore/tmock.py", line 20, in <module>
    ob = mg.Mock(spec=np.array([4, 4]))
  File 
"/home/valeriu/miniconda3/envs/esmvalcore39/lib/python3.9/unittest/mock.py", 
line 409, in __new__
    if spec_arg and _is_async_obj(spec_arg):
ValueError: The truth value of an array with more than one element is 
ambiguous. Use a.any() or a.all()

which is pretty normal since that func performs an existence check on an array 
- hope this helps! Cheers

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42586>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to