Uh oh!
There was an error while loading. Please reload this page.
Add durations to unittest in 3.12 - #10636
Conversation
This comment has been minimized.
This comment has been minimized.
| from typing_extensions import TypeAlias | ||
| _F = TypeVar("_F", bound=Callable[..., Any]) | ||
| _DurationsType: TypeAlias = list[tuple[unittest.case.TestCase, float]] |
There was a problem hiding this comment.
At least collectedDurations (ugh, camel case...) uses list[tuple[str, float]]:
There was a problem hiding this comment.
Although the docs are wrong: https://docs.python.org/3.12/library/unittest.html?highlight=collecteddurations#unittest.TestResult.collectedDurations
But even the tests use str: https://github.com/python/cpython/blob/24b9bdd6eaf0b04667b6cd4c8154f7c7c10c2398/Lib/test/test_unittest/test_runner.py#L1402
I will send a PR to CPython.
There was a problem hiding this comment.
Yeap, I used docs for this type. Let's wait for your PR to land first.
There was a problem hiding this comment.
Looks like a deliberate change to fix a circular reference, they just forgot to update the docs: python/cpython#106888
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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] |
Source commit: python/cpython@6883007