diff --git a/Tests/pens/reverseContourPen_test.py b/Tests/pens/reverseContourPen_test.py index d762c2261..c5911326e 100644 --- a/Tests/pens/reverseContourPen_test.py +++ b/Tests/pens/reverseContourPen_test.py @@ -499,8 +499,8 @@ def test_reverse_pen_outputImpliedClosingLine(): ] -@pytest.mark.parametrize("contour, expected", [(c, e) for c, _, e in TEST_DATA]) -def test_reverse_point_pen(contour, expected): +@pytest.mark.parametrize("contour, outputImpliedClosingLine, expected", TEST_DATA) +def test_reverse_point_pen(contour, outputImpliedClosingLine, expected): from fontTools.ufoLib.pointPen import ( ReverseContourPointPen, PointToSegmentPen, @@ -508,24 +508,10 @@ def test_reverse_point_pen(contour, expected): ) recpen = RecordingPen() - pt2seg = PointToSegmentPen(recpen, outputImpliedClosingLine=True) + pt2seg = PointToSegmentPen(recpen, outputImpliedClosingLine) revpen = ReverseContourPointPen(pt2seg) seg2pt = SegmentToPointPen(revpen) for operator, operands in contour: getattr(seg2pt, operator)(*operands) - # for closed contours that have a lineTo following the moveTo, - # and whose points don't overlap, our current implementation diverges - # from the ReverseContourPointPen as wrapped by ufoLib's pen converters. - # In the latter case, an extra lineTo is added because of - # outputImpliedClosingLine=True. This is redundant but not incorrect, - # as the number of points is the same in both. - if ( - contour - and contour[-1][0] == "closePath" - and contour[1][0] == "lineTo" - and contour[1][1] != contour[0][1] - ): - expected = expected[:-1] + [("lineTo", contour[0][1])] + expected[-1:] - assert recpen.value == expected