Patchwork [6,of,8] run-tests: explicitly declare the list of dropped environment variable

login
register
mail settings
Submitter Boris Feld
Date Nov. 2, 2018, 9:31 a.m.
Message ID <b95aef679522bd42e704.1541151116@localhost.localdomain>
Download mbox | patch
Permalink /patch/36329/
State Accepted
Headers show

Comments

Boris Feld - Nov. 2, 2018, 9:31 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1539906736 -7200
#      Fri Oct 19 01:52:16 2018 +0200
# Node ID b95aef679522bd42e7041373b5af9ca4ab9ce004
# Parent  063a0cb2cb31f0071c764035953fb8c3bc9bbdbc
# EXP-Topic run-tests
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r b95aef679522
run-tests: explicitly declare the list of dropped environment variable

It will make the list clearer and more maintainable.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1110,9 +1110,23 @@  class Test(unittest.TestCase):
         env['COLUMNS'] = '80'
         env['TERM'] = 'xterm'
 
-        for k in ('HG HGPROF CDPATH GREP_OPTIONS http_proxy no_proxy ' +
-                  'HGPLAIN HGPLAINEXCEPT EDITOR VISUAL PAGER ' +
-                  'NO_PROXY CHGDEBUG').split():
+        dropped = [
+            'CDPATH',
+            'CHGDEBUG',
+            'EDITOR',
+            'GREP_OPTIONS',
+            'HG',
+            'HGPLAIN',
+            'HGPLAINEXCEPT',
+            'HGPROF',
+            'http_proxy',
+            'no_proxy',
+            'NO_PROXY',
+            'PAGER',
+            'VISUAL',
+        ]
+
+        for k in dropped:
             if k in env:
                 del env[k]