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 durations to unittest in 3.12 #10636

Merged
merged 7 commits into from
Aug 30, 2023
Merged

Add durations to unittest in 3.12 #10636

merged 7 commits into from
Aug 30, 2023

Conversation

sobolevn
Copy link
Member

Source commit: python/cpython@6883007

@github-actions

This comment has been minimized.


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

Choose a reason for hiding this comment

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

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
Collaborator

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

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

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions

This comment has been minimized.

stdlib/unittest/runner.pyi Outdated Show resolved Hide resolved
stdlib/unittest/runner.pyi Outdated Show resolved Hide resolved
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions
Copy link
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 AlexWaygood merged commit c9583d9 into main Aug 30, 2023
66 checks passed
@AlexWaygood AlexWaygood deleted the py312-unittest branch August 30, 2023 10:35
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.

None yet

3 participants