-
Notifications
You must be signed in to change notification settings - Fork 89
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
Pytest 8: AttributeError: 'TestExpectedException' object has no attribute 'runTest'. Did you mean: 'subTest'? #372
Comments
Please use either the test tools test runner or the native python test runner (unittest) We're open to PRs that improve support for running the test with third party runners like pytest, but it's not a priority for the project. |
See also #332 |
Details why this happens is found here pytest-dev/pytest#12263 (comment) |
ncopa
added a commit
to ncopa/testtools
that referenced
this issue
May 13, 2024
pytest 82. relies on a feature of `unittest.TestCase` where the initialization of it with the default `methodName="runTest"` is treated specially, allowing it to insantiate even without `runTest` method actually existing. See under "Changed in Python 3.2" in unittest.TestCase docs This fixes the error with pytest 8.2: AttributeError: 'TestUtil' object has no attribute 'runTest'. Did you mean: 'subTest'? Fixes: testing-cabal#372 ref: https://docs.python.org/3/library/unittest.html#unittest.TestCase ref: https://github.com/python/cpython/blob/51aefc5bf907ddffaaf083ded0de773adcdf08c8/Lib/unittest/case.py#L419-L426 ref: pytest-dev/pytest#12263 (comment)
ncopa
added a commit
to ncopa/testtools
that referenced
this issue
May 13, 2024
pytest 8.2 relies on a feature of `unittest.TestCase` where the initialization of it with the default `methodName="runTest"` is treated specially, allowing it to insantiate even without `runTest` method actually existing. See under "Changed in Python 3.2" in unittest.TestCase docs This fixes the error with pytest 8.2: AttributeError: 'TestUtil' object has no attribute 'runTest'. Did you mean: 'subTest'? Fixes: testing-cabal#372 ref: https://docs.python.org/3/library/unittest.html#unittest.TestCase ref: https://github.com/python/cpython/blob/51aefc5bf907ddffaaf083ded0de773adcdf08c8/Lib/unittest/case.py#L419-L426 ref: pytest-dev/pytest#12263 (comment)
ncopa
added a commit
to ncopa/testtools
that referenced
this issue
May 13, 2024
pytest 8.2 relies on a feature of `unittest.TestCase` where the initialization of it with the default `methodName="runTest"` is treated specially, allowing it to insantiate even without `runTest` method actually existing. See under "Changed in Python 3.2" in unittest.TestCase docs This fixes the error with pytest 8.2: AttributeError: 'TestUtil' object has no attribute 'runTest'. Did you mean: 'subTest'? Fixes: testing-cabal#372 ref: https://docs.python.org/3/library/unittest.html#unittest.TestCase ref: https://github.com/python/cpython/blob/51aefc5bf907ddffaaf083ded0de773adcdf08c8/Lib/unittest/case.py#L419-L426 ref: pytest-dev/pytest#12263 (comment)
jelmer
pushed a commit
to ncopa/testtools
that referenced
this issue
May 13, 2024
pytest 8.2 relies on a feature of `unittest.TestCase` where the initialization of it with the default `methodName="runTest"` is treated specially, allowing it to insantiate even without `runTest` method actually existing. See under "Changed in Python 3.2" in unittest.TestCase docs This fixes the error with pytest 8.2: AttributeError: 'TestUtil' object has no attribute 'runTest'. Did you mean: 'subTest'? Fixes: testing-cabal#372 ref: https://docs.python.org/3/library/unittest.html#unittest.TestCase ref: https://github.com/python/cpython/blob/51aefc5bf907ddffaaf083ded0de773adcdf08c8/Lib/unittest/case.py#L419-L426 ref: pytest-dev/pytest#12263 (comment)
ncopa
added a commit
to ncopa/testtools
that referenced
this issue
May 13, 2024
pytest 8.2 relies on a feature of `unittest.TestCase` where the initialization of it with the default `methodName="runTest"` is treated specially, allowing it to insantiate even without `runTest` method actually existing. See under "Changed in Python 3.2" in unittest.TestCase docs This fixes the error with pytest 8.2: AttributeError: 'TestUtil' object has no attribute 'runTest'. Did you mean: 'subTest'? Fixes: testing-cabal#372 ref: https://docs.python.org/3/library/unittest.html#unittest.TestCase ref: https://github.com/python/cpython/blob/51aefc5bf907ddffaaf083ded0de773adcdf08c8/Lib/unittest/case.py#L419-L426 ref: pytest-dev/pytest#12263 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
we are using pytest for running bandit and python-etcd3gw tests. Since pytest 8 the tests are failing with
AttributeError: 'XXX' object has no attribute 'runTest'. Did you mean: 'subTest'?
See:
https://download.copr.fedorainfracloud.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07388287-bandit/builder-live.log.gz
https://download.copr.fedorainfracloud.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07424137-python-etcd3gw/builder-live.log.gz
Reproducer:
The text was updated successfully, but these errors were encountered: