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

Add addDuration() to support Python >= 3.12 #570

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Apr 23, 2023

A subset of #568
Fixes: #569

See the Python 3.12 changes discussed at #569 (comment)

@cclauss cclauss changed the title Add addDuration() for Python >= 3.12 Add addDuration() to support Python >= 3.12 Apr 23, 2023
@sirosen
Copy link
Collaborator

sirosen commented Apr 25, 2023

Thanks for contributing this! I'm going to read up a bit both on what we have in nose2 and on how this is implemented in unittest before I merge, to confirm that making it a no-op is the right thing to do.

@sirosen
Copy link
Collaborator

sirosen commented Apr 25, 2023

Okay, after reading through again, I don't think there's an obvious better quick solution. Probably this would translate to a new event type in nose2 if we wanted to continue to try to follow the model which exists, but I'm not sure that's such a great idea given the current age and status of the project (and how little time I end up making for it).

Once again, thanks for not only identifying this but also putting in a PR with the fix.

@sirosen sirosen merged commit 8884064 into nose-devs:main Apr 25, 2023
@cclauss cclauss deleted the support_addDuration_in_Python_3.12 branch April 25, 2023 22:09
iilyak added a commit to apache/couchdb that referenced this pull request May 15, 2024
The `unittest.TestCase` class in python 3.12 has a new addDuration method.
The nose extends that class without providing the implementation for the method.
This has been fixed in following PR nose-devs/nose2#570.
The PR was included in 0.13. This version requires python >= 3.5. Which is a
minimum required version for CouchDB as well.

The original warning message (for 3.12/3.12.2_1)

```
The python version >= 3.12 doesn't provide
3.12/lib/python3.12/unittest/case.py:580:
  RuntimeWarning: TestResult has no addDuration method
    warnings.warn("TestResult has no addDuration method",
```
iilyak added a commit to apache/couchdb that referenced this pull request May 15, 2024
The `unittest.TestCase` class in python 3.12 has a new addDuration method.
The nose extends that class without providing the implementation for the method.
This has been fixed in following PR nose-devs/nose2#570.
The PR was included in 0.13. This version requires python >= 3.5. Which is a
minimum required version for CouchDB as well.

The original warning message (for 3.12/3.12.2_1)

```
The python version >= 3.12 doesn't provide
3.12/lib/python3.12/unittest/case.py:580:
  RuntimeWarning: TestResult has no addDuration method
    warnings.warn("TestResult has no addDuration method",
```
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.

GitHub tests are failing on Python 3.12 alpha 7
2 participants