tests: support NOCOLOR env variable
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Jul 2012 22:13:18 +0000 (15:13 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Jul 2012 22:13:18 +0000 (15:13 -0700)
pym/portage/tests/resolver/ResolverPlayground.py
pym/portage/tests/runTests

index e65f9f8ff6a0f20124aa1bd62d401450ad43db59..0ac209761a8296f84fc0c3b3ad444331376c64ae 100644 (file)
@@ -503,6 +503,9 @@ class ResolverPlayground(object):
                        'PORTAGE_TMPDIR'       : os.path.join(self.eroot, 'var/tmp'),
                }
 
+               if os.environ.get("NOCOLOR"):
+                       env["NOCOLOR"] = os.environ["NOCOLOR"]
+
                if os.environ.get("SANDBOX_ON") == "1":
                        # avoid problems from nested sandbox instances
                        env["FEATURES"] = "-sandbox"
index 91984a3a3f9b462971b92e01709f030e86c5662f..1c1008dfff2d821471c7f1248b28cea7ef237467 100755 (executable)
@@ -37,6 +37,9 @@ import portage
 # work the same regardless of global configuration file state/existence.
 portage._disable_legacy_globals()
 
+if os.environ.get('NOCOLOR') in ('yes', 'true'):
+       portage.output.nocolor()
+
 import portage.tests as tests
 from portage.const import PORTAGE_BIN_PATH
 path = os.environ.get("PATH", "").split(":")