[PATCH] tests: test-ui-color.py fails from a dumb terminal

Matt Mackall mpm at selenic.com
Tue May 8 15:51:12 CDT 2012


On Mon, 2012-05-07 at 11:10 -0400, Jesse Glick wrote:
> On 05/04/2012 05:50 PM, Matt Mackall wrote:
> >> Need to skip in this environment
> >
> > I think run-tests should either eliminate or standardize the TERM
> > variable instead?
> 
> Not sure. What would it be standardized to? The code line in question seems to be
> 
>    formatted = always or (os.environ.get('TERM') != 'dumb' and ui.formatted())

This is what I ended up doing:

diff -r 726dd0fc7cfe tests/run-tests.py
--- a/tests/run-tests.py	Sun May 06 17:12:22 2012 -0700
+++ b/tests/run-tests.py	Tue May 08 15:46:59 2012 -0500
@@ -1187,6 +1187,7 @@
     os.environ['http_proxy'] = ''
     os.environ['no_proxy'] = ''
     os.environ['NO_PROXY'] = ''
+    os.environ['TERM'] = 'xterm'
 
     # unset env related to hooks
     for k in os.environ.keys():

In our synthetic environment, hg will think it's in an xterm and act
accordingly, matching the behavior the original test author got when
they wrote the test.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list