Conversation
This comment has been minimized.
This comment has been minimized.
stdlib/unittest/result.pyi
Outdated
| 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.
|
Diff from mypy_primer, showing the effect of this PR on open source code: |
Source commit: python/cpython@6883007