#8783 defect closed duplicate (duplicate)

wsgi test failures with PyPy reprs

Reported by: mark williams Owned by:
Priority: normal Milestone: PyPy-support
Component: core Keywords:
Cc: Branch:
Author:

Description

twisted.web.test.test_wsgi.StartResponseTests.test_headersMustBeSequence and twisted.web.test.test_wsgi.StartResponseTests.test_headersMustEachBeSequence fail because the repr of the embedded object in the error message differs on PyPy.

For example, the error message reported if the headers object is not a list includes %r, and the test returns iter(()).

On PyPy, iter(()) returns a "sequenceiterator":

Python 2.7.10 (5.1.2+dfsg-1, May 17 2016, 18:03:30)
[PyPy 5.1.2 with GCC 5.3.1 20160509] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>> iter(())
<sequenceiterator object at 0x00007f799e54eba0>

While on CPython, it returns a tuple iterator as expected by the test:

Python 2.7.12 (default, Aug  4 2016, 20:04:34) 
[GCC 6.1.1 20160724] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> iter(())
<tupleiterator object at 0x7f4d2fac1050>

Change History (1)

comment:1 Changed 16 months ago by mark williams

Resolution: duplicate
Status: newclosed

Dupe of #8629

Note: See TracTickets for help on using tickets.