GeezerVison is showing github.com — bpo-4080: unittest durations by giampaolo · Pull Request #12271 · python/cpython
Conversation
giampaolo
commented
Mar 11, 2019
•
edited by bedevere-bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Adds cmdline option to show unit-tests durations + summary of the slowest ones, see https://bugs.python.org/issue4080.
Top 5 slowest ones:
$ ./python -m unittest Lib.test.test_ftplib --durations=5
..........................................s.............................................
Slowest test durations
----------------------------------------------------------------------
0.203s test_with_statement (Lib.test.test_ftplib.TestFTPClass)
0.204s test_retrbinary_rest (Lib.test.test_ftplib.TestTLS_FTPClassMixin)
0.214s test_with_statement (Lib.test.test_ftplib.TestTLS_FTPClassMixin)
0.881s test_mlsd (Lib.test.test_ftplib.TestFTPClass)
1.162s test_mlsd (Lib.test.test_ftplib.TestTLS_FTPClassMixin)
----------------------------------------------------------------------
Ran 88 tests in 5.264s
OK (skipped=1)
All + individual elapsed time:
$ ./python -m unittest Lib.test.test_ftplib --durations=0 -v
test_abort (Lib.test.test_ftplib.TestFTPClass) ... [0.002s] ok
test_all_errors (Lib.test.test_ftplib.TestFTPClass) ... [0.001s] ok
test_cwd (Lib.test.test_ftplib.TestFTPClass) ... [0.001s] ok
test_delete (Lib.test.test_ftplib.TestFTPClass) ... [0.001s] ok
test_dir (Lib.test.test_ftplib.TestFTPClass) ... [0.041s] ok
test_mlsd (Lib.test.test_ftplib.TestFTPClass) ... [0.880s] ok
test_nlst (Lib.test.test_ftplib.TestFTPClass) ... [0.092s] ok
test_parse257 (Lib.test.test_ftplib.TestFTPClass) ... [0.002s] ok
...
Slowest test durations
----------------------------------------------------------------------
0.000s test__all__ (Lib.test.test_ftplib.MiscTestCase)
0.002s test_pwd (Lib.test.test_ftplib.TestFTPClass)
....
0.140s test_storbinary_rest (Lib.test.test_ftplib.TestTLS_FTPClassMixin)
0.148s test_data_connection (Lib.test.test_ftplib.TestTLS_FTPClass)
0.154s test_storlines (Lib.test.test_ftplib.TestTLS_FTPClassMixin)
0.175s test_retrbinary_rest (Lib.test.test_ftplib.TestTLS_FTPClassMixin)
0.204s test_with_statement (Lib.test.test_ftplib.TestFTPClass)
0.208s test_with_statement (Lib.test.test_ftplib.TestTLS_FTPClassMixin)
0.880s test_mlsd (Lib.test.test_ftplib.TestFTPClass)
1.281s test_mlsd (Lib.test.test_ftplib.TestTLS_FTPClassMixin)
----------------------------------------------------------------------
Ran 88 tests in 5.396s
OK (skipped=1)
https://bugs.python.org/issue4080
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dfrankow, manuel-91, jdufresne, sperez8, 153957, TAAPArthur, philbucher, andprosoft, calumah, eggplants, and 9 more reacted with thumbs up emoji
eggplants reacted with rocket emoji
All reactions
-
👍
19 reactions
-
🚀
1 reaction
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Hi @iritkatriel and thanks for taking a look at this. I have merged all test conflicts and polished the implementation a little, since the PR was 3 years and unittest code changed in the meantime.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
eggplants reacted with confused emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
gpshead reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as off-topic.
|
Hidden buildbot failure was for test_asyncio. I presume unrelated since random test_asyncio failures are unfortunately routine.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
giampaolo
commented
Apr 3, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@eggplants wrote:
@giampaolo @LiteApplication doesn't appear to be a regular Python reviewer, is it no problem to merge?
Sorry, I didn't realize that. This was an old PR that unfortunately never received much attention, so it stayed idle for a long time and I occasionally updated it to fix merge conflicts. When I finally saw an approval I was just happy to see it and merged it without further checking. FWIW, I went through these changes multiple times over the last 4 years: I'm confident that the changes introduced in here are OK and are fully retro compatible (this probably was the most sensitive part to consider).
|
eggplants reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Anyway, I am glad this feature has finally been merged. Thank you @giampaolo -san.
|
giampaolo reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Here's a nose issue related to this PR's retro-compatibility: nose-devs/nose2#569.
nose extended TestCase class without defining the new addDuration method. Python 3.12 emitted a warning but it didn't crash.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Sep 2, 2026
Reviewers
gpshead
gpshead left review comments
tirkarthi
Awaiting requested review from tirkarthi
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|