Bug 46634 - webkitpy.common.system.user_unittest.UserTest.test_prompt_with_list spams the console
Summary: webkitpy.common.system.user_unittest.UserTest.test_prompt_with_list spams the...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-27 11:10 PDT by Eric Seidel (no email)
Modified: 2010-09-27 15:43 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.96 KB, patch)
2010-09-27 11:32 PDT, Mihai Parparita
no flags Details | Formatted Diff | Diff
Patch (3.60 KB, patch)
2010-09-27 11:50 PDT, Mihai Parparita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2010-09-27 11:10:14 PDT
webkitpy.common.system.user_unittest.UserTest.test_prompt_with_list spams the console

Should use OutputCapture instead.  See outputcapture.py (or other unittest examples.

test_prompt_with_list (webkitpy.common.system.user_unittest.UserTest) ... title
 1. foo
 2. bar
title
 1. foo
 2. bar
title
 1. foo
 2. bar
title
 1. foo
 2. bar
title
 1. foo
 2. bar
title
 1. foo
 2. bar
title
 1. foo
 2. bar
title
 1. foo
 2. bar
ok
Comment 1 Mihai Parparita 2010-09-27 11:32:44 PDT
Created attachment 68935 [details]
Patch
Comment 2 Adam Barth 2010-09-27 11:36:29 PDT
Comment on attachment 68935 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=68935&action=review

> WebKitTools/Scripts/webkitpy/common/system/user_unittest.py:56
> +            # Don't care about output.

Why not assert that the output is correct?
Comment 3 Eric Seidel (no email) 2010-09-27 11:37:35 PDT
Comment on attachment 68935 [details]
Patch

Seems OK.  We could care about the output.  assert_outputs will return the value of the function it calls.  The comment should probably say "Other tests cover output, this test only checks parsing behavior" or similar.

I guess I should implement __enter__ and __exit__ for OutputCapture so we can use it with "with"
Comment 4 Mihai Parparita 2010-09-27 11:50:49 PDT
Created attachment 68938 [details]
Patch
Comment 5 Eric Seidel (no email) 2010-09-27 11:54:16 PDT
Comment on attachment 68938 [details]
Patch

LGTM!  THanks.
Comment 6 WebKit Commit Bot 2010-09-27 11:56:41 PDT
Comment on attachment 68938 [details]
Patch

Rejecting patch 68938 from commit-queue.

Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', 'apply-attachment', '--force-clean', '--non-interactive', '--quiet', 68938]" exit_code: 2
Cleaning working directory
Updating working directory
Failed to run "['WebKitTools/Scripts/update-webkit']" exit_code: 2

Full output: http://queues.webkit.org/results/4131015
Comment 7 WebKit Commit Bot 2010-09-27 15:42:55 PDT
Comment on attachment 68938 [details]
Patch

Clearing flags on attachment: 68938

Committed r68432: <http://trac.webkit.org/changeset/68432>
Comment 8 WebKit Commit Bot 2010-09-27 15:43:01 PDT
All reviewed patches have been landed.  Closing bug.