I have a large library with many doctests. All doctests pass on Python 3.8; however, on Python 3.9, 3.10 and 3.11, I get many errors of the following type:
Expected:
[13.0, 12.0, 7.0]
Got:
[np.float64(13.0), np.float64(12.0), np.float64(7.0)]
I.e., the results are correct, but for some reason, they are displayed inside “np.float64”.
In my code, I do not use np.float64 at all, so I do not know why this happens. Is there a way I can make the doctests pass again, without changing each individual test?