lxml.doctestcompare swaps "expected" and "actual" in attribute values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Medium
|
scoder |
Bug Description
Here's a test case:
$ python2.7
>>> import doctest
>>> __test__ = dict(ex='''
... >>> import lxml.usedoctest
... >>> print '<p title="
... <p title="
... ''')
>>> doctest.testmod()
***
File "__main__", line ?, in __main_
Failed example:
print '<p title="
Expected:
<p title="
Got:
<p title="
Diff:
<p title="actual (got: expected)">Expected (got: Actual)</p>
***
1 items had failures:
1 of 2 in __main_
***Test Failed*** 1 failures.
TestResults
Look closely at the diff: the element body is shown correctly (expected "Expected", got "Actual"), but in the attribute value the expected and actual strings got swapped.
Additional info:
Python : sys.version_
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)
Thanks! Fixed here:
https:/ /github. com/lxml/ lxml/commit/ ce0d5931b9e5293 b8375457de2e40c 9c197f4dda