lxml.doctestcompare swaps "expected" and "actual" in attribute values

Bug #1238500 reported by Marius Gedminas
6
This bug affects 1 person
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="actual">Actual</p>'
    ... <p title="expected">Expected</p>
    ... ''')
    >>> doctest.testmod()
    **********************************************************************
    File "__main__", line ?, in __main__.__test__.ex
    Failed example:
        print '<p title="actual">Actual</p>'
    Expected:
      <p title="expected">Expected</p>

    Got:
      <p title="actual">Actual</p>

    Diff:
      <p title="actual (got: expected)">Expected (got: Actual)</p>
    **********************************************************************
    1 items had failures:
       1 of 2 in __main__.__test__.ex
    ***Test Failed*** 1 failures.
    TestResults(failed=1, attempted=2)

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_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)

Revision history for this message
scoder (scoder) wrote :
Changed in lxml:
assignee: nobody → scoder (scoder)
importance: Undecided → Medium
milestone: none → 3.3
status: New → Fix Committed
Revision history for this message
scoder (scoder) wrote :

Fixed in lxml 3.3.2.

Changed in lxml:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.