tornadoweb / tornado

Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
http://www.tornadoweb.org/
Apache License 2.0
21.76k stars 5.51k forks source link

Under pytest 8.2.0, 'AsyncHTTPTestCase' has no attribute 'runTest' #3375

Closed sirosen closed 5 months ago

sirosen commented 6 months ago

I'm one of the maintainers of webargs (https://github.com/marshmallow-code/webargs), and we've had some CI failures start cropping up in the last couple of days related to our tornado support tests. When I start looking in detail, I see that tornado hasn't released in the very recent past, but pytest has, and that the issue appears to be tied to pytest's recent 8.2.0 release.

I have some more detail, in the webargs context, written up over here: https://github.com/marshmallow-code/webargs/issues/941 All I really have so far is that test collection fails with this trace:

____________________ ERROR collecting tests/test_tornadoparser.py ____________________
.tox/py311/lib/python3.11/site-packages/tornado/testing.py:180: in __init__
    setattr(self, methodName, _TestMethodWrapper(getattr(self, methodName)))
E   AttributeError: 'AsyncHTTPTestCase' object has no attribute 'runTest'
____________________ ERROR collecting tests/test_tornadoparser.py ____________________
.tox/py311/lib/python3.11/site-packages/tornado/testing.py:180: in __init__
    setattr(self, methodName, _TestMethodWrapper(getattr(self, methodName)))
E   AttributeError: 'TestApp' object has no attribute 'runTest'
____________________ ERROR collecting tests/test_tornadoparser.py ____________________
.tox/py311/lib/python3.11/site-packages/tornado/testing.py:180: in __init__
    setattr(self, methodName, _TestMethodWrapper(getattr(self, methodName)))
E   AttributeError: 'TestValidateApp' object has no attribute 'runTest'

and that downgrading pytest to 8.1.2 fixes it.

Apologies if this turns out to be a problem with my usage, or a pytest issue (rather than a tornado one), but I wanted to raise it here for visibility.

sirosen commented 6 months ago

I think this would be closed by #3374 -- I've just been putting the pieces together from my end.