I got this fail report:
Document: readme
----------------
**********************************************************************
File "readme.rst", line ?, in default
Failed example:
a
Expected:
array(['Joe', 'Jane'],
dtype='<U4')
Got:
array(['Joe', 'Jane'],
dtype='<U4')
**********************************************************************
There is a number of questions like this:
Doctest returning failure, yet "Expected" and "Got" match perfectly
python doctest: expected result is the same as the "got" result but the test failed
They all suggest looking for 'hidden' characters or spaces.
My reStructuredText looks like this:
test1:
>>> a = np.array(['Joe', 'Jane'])
>>> a
array(['Joe', 'Jane'],
dtype='<U4')
test2:
>>> b = np.array([1,2,3])
>>> b
array([1, 2, 3])
test2 ran just fine.
I ran the code in a python command line and copy-pasted the result in the reStructuredtext, yet get this error. I copied the text from the fail report and pasted it back in a python string and compared with a==b (got True). I have many other examples in the same file that doctest just fine.
What can the hidden character possibly be and how do I get rid of it? What else can I do to figure where the problem is?
Is the there maybe something specific about numpy arrays?
I'd think this example is simple enough that other people must have stumbled on it...