**********************************************************************
File "__main__", line ?, in __main__.__test__.ex
Failed example:
print 'One\nTwo\nThree' # doctest: +REPORT_NDIFF
Differences (ndiff with -expected +actual):
One
+ Two
+ Three
It uses '+' to indicate items in actual output that were not present in the expected output.
Compare with what lxml produces:
**********************************************************************
File "__main__", line ?, in __main__.__test__.ex
Failed example:
print '<p><span>One</span><b>Two</b><em>Three</em></p>'
Expected:
<p> <span>One</span>
</p>
Test case:
$ python2.7 One</span> <b>Two< /b><em> Three</ em></p> ' <span>One< /span>< /p>
>>> import doctest
>>> __test__ = dict(ex=r'''
>>> print 'One\nTwo\nThree' # doctest: +REPORT_NDIFF
One
>>> import lxml.usedoctest
>>> print '<p><span>
<p>
''')
>>> doctest.testmod()
Now look at the diff of the first example:
*** ******* ******* ******* ******* ******* ******* ******* ******* ******* **** _.__test_ _.ex
File "__main__", line ?, in __main_
Failed example:
print 'One\nTwo\nThree' # doctest: +REPORT_NDIFF
Differences (ndiff with -expected +actual):
One
+ Two
+ Three
It uses '+' to indicate items in actual output that were not present in the expected output.
Compare with what lxml produces:
*** ******* ******* ******* ******* ******* ******* ******* ******* ******* **** _.__test_ _.ex One</span> <b>Two< /b><em> Three</ em></p> '
<span> One</span>
File "__main__", line ?, in __main_
Failed example:
print '<p><span>
Expected:
<p>
</p>
Got:
<span> One</span>
<em>Three< /em>
<p>
<b>Two</b>
</p>
Diff:
<span> One</span>
-<em>Three< /em> ******* ******* ******* ******* ******* ******* ******* ******* ******* ****
<p>
-<b>Two</b>
</p>
***
It uses '-' for the same purpose.
Additional info:
Python : sys.version_ info(major= 2, minor=7, micro=4, releaselevel= 'final' , serial=0)
lxml.etree : (3, 1, 0, 0)
libxml used : (2, 9, 0)
libxml compiled : (2, 9, 0)
libxslt used : (1, 1, 27)
libxslt compiled : (1, 1, 27)