Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/test_tornado.py::TestTornado - AttributeError: 'TestTornado' object has no attribute 'runTest' w/ pytest-8.2.0 #460

Open
mgorny opened this issue May 8, 2024 · 4 comments

Comments

@mgorny
Copy link

mgorny commented May 8, 2024

When trying to run tests, I'm getting the following error:

$ tox -e py311
py311: install_deps> python -I -m pip install '.[doc]' '.[test]'
.pkg-cpython311: install_requires> python -I -m pip install 'setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2.0,!=34.3.0,!=34.3.1,!=34.3.2,!=36.2.0,>=21.0.0' 'setuptools_scm[toml]>=3.4'
.pkg-cpython311: _optional_hooks> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg-cpython311: get_requires_for_build_editable> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg-cpython311: install_requires_for_build_editable> python -I -m pip install setuptools_scm wheel
.pkg-cpython311: build_editable> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta
py311: install_package> python -I -m pip install --force-reinstall --no-deps /tmp/tenacity/.tox/.tmp/package/1/tenacity-8.3.0-0.editable-py3-none-any.whl
py311: commands[0]> pytest
========================================================= test session starts =========================================================
platform linux -- Python 3.11.9, pytest-8.2.0, pluggy-1.5.0
cachedir: .tox/py311/.pytest_cache
rootdir: /tmp/tenacity
configfile: setup.cfg
plugins: typeguard-4.2.1
collected 109 items / 1 error                                                                                                         

=============================================================== ERRORS ================================================================
_______________________________________________ ERROR collecting tests/test_tornado.py ________________________________________________
.tox/py311/lib/python3.11/site-packages/tornado/testing.py:180: in __init__
    setattr(self, methodName, _TestMethodWrapper(getattr(self, methodName)))
E   AttributeError: 'TestTornado' object has no attribute 'runTest'
======================================================= short test summary info =======================================================
ERROR tests/test_tornado.py::TestTornado - AttributeError: 'TestTornado' object has no attribute 'runTest'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================== 1 error in 0.27s ===========================================================
py311: exit 2 (0.68 seconds) /tmp/tenacity> pytest pid=22558
  py311: FAIL code 2 (23.57=setup[22.89]+cmd[0.68] seconds)
  evaluation failed :( (29.50 seconds)

This is a regression after upgrading to pytest-8.2.0.

@stanislavlevin
Copy link

JFYI:
tornadoweb/tornado#3375
tornadoweb/tornado#3374

@LilMonk
Copy link

LilMonk commented May 22, 2024

Although its a Tornado issue. I made the test work by adding:

class TestTornado(testing.AsyncTestCase):  # type: ignore[misc]
    ...
    def runTest(self):
        self.subTest()

Just waiting for the fix. 😄

@kloczek
Copy link

kloczek commented Jun 1, 2024

Could you please drop the patch for that? 🤔

@LilMonk
Copy link

LilMonk commented Jun 1, 2024

The patch is not expected in tenacity rather it is from tornado's side.
Refer:

JFYI: tornadoweb/tornado#3375 tornadoweb/tornado#3374

@jd jd mentioned this issue Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants