From 48497bca12ac8b52740681a7a10200f0a58345ea Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 11 Jul 2012 15:13:18 -0700 Subject: tests: support NOCOLOR env variable --- pym/portage/tests/resolver/ResolverPlayground.py | 3 +++ pym/portage/tests/runTests | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py index e65f9f8ff..0ac209761 100644 --- a/pym/portage/tests/resolver/ResolverPlayground.py +++ b/pym/portage/tests/resolver/ResolverPlayground.py @@ -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" diff --git a/pym/portage/tests/runTests b/pym/portage/tests/runTests index 91984a3a3..1c1008dff 100755 --- a/pym/portage/tests/runTests +++ b/pym/portage/tests/runTests @@ -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(":") -- cgit v1.2.3-1-g7c22