Merge lp:~stevenk/launchpad/subunit-default-not-a-tty into lp:launchpad

Proposed by Steve Kowalik
Status: Work in progress
Proposed branch: lp:~stevenk/launchpad/subunit-default-not-a-tty
Merge into: lp:launchpad
Diff against target: 22 lines (+4/-1)
1 file modified
buildout-templates/bin/test.in (+4/-1)
To merge this branch: bzr merge lp:~stevenk/launchpad/subunit-default-not-a-tty
Reviewer Review Type Date Requested Status
Robert Collins (community) Needs Fixing
Review via email: mp+82352@code.launchpad.net

Description of the change

Scratch an itch -- if bin/test's stdout is not a tty, then turn on the --subunit option.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

So its a small change, but I think we need an opt-out per IRC.

review: Needs Fixing

Unmerged revisions

14303. By Steve Kowalik

If stdout of bin/test is not a tty, turn on subunit.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout-templates/bin/test.in'
2--- buildout-templates/bin/test.in 2011-07-15 15:46:51 +0000
3+++ buildout-templates/bin/test.in 2011-11-16 05:38:25 +0000
4@@ -47,7 +47,6 @@
5
6 # Make tests run in a timezone no launchpad developers live in.
7 # Our tests need to run in any timezone.
8-# (This is no longer actually required, as PQM does this.)
9 os.environ['TZ'] = 'Asia/Calcutta'
10 time.tzset()
11
12@@ -245,6 +244,10 @@
13 # edge case, so we don't have to care about it.
14 options.parser.defaults[name] = value
15
16+ # If stdout is not a tty, turn on subunit.
17+ if not sys.stdout.isatty():
18+ options.subunit = True
19+
20 # Turn on Layer profiling if requested.
21 from canonical.testing import profiled
22 if local_options.verbose >= 3 and main_process: