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

testing: Replace _TestMethodWrapper with _callTestMethod #3382

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

bdarnell
Copy link
Member

@bdarnell bdarnell commented Jun 3, 2024

Overriding _callTestMethod (which was introduced in python 3.8) is a less hacky way to detect tests that fail to use @gen_test where needed. It's not documented, but since Python 3.11 has introduced a similar check to the standard library we'll be able to remove it in the near future.

The major impetus for this change is an incompatibility with Pytest 8.2, which has made a change that tries to instantiate test classes at discovery time without an existing method name.

Fixes #3375
Closes #3374

Overriding _callTestMethod (which was introduced in python 3.8) is a
less hacky way to detect tests that fail to use ``@gen_test`` where
needed. It's not documented, but since Python 3.11 has introduced a
similar check to the standard library we'll be able to remove it in the
near future.

The major impetus for this change is an incompatibility with
Pytest 8.2, which has made a change that tries to instantiate test
classes at discovery time without an existing method name.

Fixes tornadoweb#3375
Closes tornadoweb#3374
@bdarnell bdarnell merged commit b109915 into tornadoweb:master Jun 3, 2024
12 checks passed
@bdarnell bdarnell deleted the remove-testmethodwrapper branch June 3, 2024 20:38
@arossert
Copy link

arossert commented Jun 5, 2024

@bdarnell Any plans to create a new release with this fix?

dave-shawley added a commit to dave-shawley/tornado-problem-details that referenced this pull request Jun 5, 2024
This is fixed in the mainline but I'm going to downgrade pytest for the
time being.

tornadoweb/tornado#3382
dave-shawley added a commit to dave-shawley/tornado-problem-details that referenced this pull request Jun 5, 2024
This is fixed in the mainline but I'm going to downgrade pytest for the
time being.

tornadoweb/tornado#3382
@bdarnell
Copy link
Member Author

bdarnell commented Jun 7, 2024

This was included in 6.4.1 that went out yesterday.

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

Successfully merging this pull request may close these issues.

Under pytest 8.2.0, 'AsyncHTTPTestCase' has no attribute 'runTest'
2 participants