FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add `durations` to `unittest` in 3.12 by sobolevn · Pull Request #10636 · python/typeshed · GitHub

Repository navigation

Add durations to unittest in 3.12 - #10636

Merged
AlexWaygood merged 7 commits into
mainfrom
py312-unittest
Aug 30, 2023
Merged

AlexWaygood merged 7 commits into
mainfrom
py312-unittest

Conversation

Copy link
Copy Markdown
Member

Source commit: python/cpython@6883007

This comment has been minimized.

Comment thread stdlib/unittest/result.pyi Outdated
from typing_extensions import TypeAlias

_F = TypeVar("_F", bound=Callable[..., Any])
_DurationsType: TypeAlias = list[tuple[unittest.case.TestCase, float]]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

At least collectedDurations (ugh, camel case...) uses list[tuple[str, float]]:

https://github.com/python/cpython/blob/24b9bdd6eaf0b04667b6cd4c8154f7c7c10c2398/Lib/unittest/result.py#L170

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeap, I used docs for this type. Let's wait for your PR to land first.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks like a deliberate change to fix a circular reference, they just forgot to update the docs: python/cpython#106888

srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

This comment has been minimized.

Comment thread stdlib/unittest/runner.pyi Outdated
Comment thread stdlib/unittest/runner.pyi Outdated

AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/runtests.py:72: error: Unused "type: ignore" comment  [unused-ignore]
+ tornado/test/runtests.py:78: error: Unused "type: ignore" comment  [unused-ignore]

AlexWaygood merged commit c9583d9 into main Aug 30, 2023
AlexWaygood deleted the py312-unittest branch August 30, 2023 10:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL