8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
durations
unittest
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
Source commit: python/cpython@6883007
Sorry, something went wrong.
Add durations to unittest in 3.12
3e08f92
[pre-commit.ci] auto fixes from pre-commit.com hooks
b011b95
Typo
f3f9767
There was a problem 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]]:
collectedDurations
list[tuple[str, float]]
https://github.com/python/cpython/blob/24b9bdd6eaf0b04667b6cd4c8154f7c7c10c2398/Lib/unittest/result.py#L170
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
str
I will send a PR to CPython.
Yeap, I used docs for this type. Let's wait for your PR to land first.
Looks like a deliberate change to fix a circular reference, they just forgot to update the docs: python/cpython#106888
TestResult.collectedDurations
Address review
09bca56
Thanks!
b6e4128
395318a
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]
c9583d9
srittau srittau approved these changes
AlexWaygood AlexWaygood approved these changes
Successfully merging this pull request may close these issues.