[Piglit] [PATCH 1/3] framework: Never redirect sys.stderr to /dev/null.

Jose Fonseca jfonseca at vmware.com
Tue Dec 8 05:23:28 PST 2015


Awful idea, as it prevents easy debugging/diagnosis of framework issues.

If the test is verbose, then the child process' stderr should be
redirected, and not Python's process.
---
 framework/tests/profile_tests.py    |  3 ---
 framework/tests/run_parser_tests.py | 10 ----------
 2 files changed, 13 deletions(-)

diff --git a/framework/tests/profile_tests.py b/framework/tests/profile_tests.py
index 3a7d68b..010dbc3 100644
--- a/framework/tests/profile_tests.py
+++ b/framework/tests/profile_tests.py
@@ -31,9 +31,6 @@ from framework.tests import utils
 from framework import grouptools, dmesg, profile, exceptions, options
 from framework.test import GleanTest
 
-# Don't print sys.stderr to the console
-sys.stderr = sys.stdout
-
 
 @utils.no_error
 def test_initialize_testprofile():
diff --git a/framework/tests/run_parser_tests.py b/framework/tests/run_parser_tests.py
index 5f0b21b..677adfc 100644
--- a/framework/tests/run_parser_tests.py
+++ b/framework/tests/run_parser_tests.py
@@ -156,11 +156,6 @@ class TestBackend(_Helpers):
         self._unset_config()
         self._move_piglit_conf()
 
-        # This has sideffects, it shouldn't effect anything in this module, but
-        # it may cause later problems. But without this we get ugly error spew
-        # from this test.
-        sys.stderr = open(os.devnull, 'w')
-
         with utils.tempdir() as tdir:
             with open(os.path.join(tdir, 'piglit.conf'), 'w') as f:
                 f.write('[core]\nbackend=foobar')
@@ -249,11 +244,6 @@ class TestPlatform(_Helpers):
         self._unset_config()
         self._move_piglit_conf()
 
-        # This has sideffects, it shouldn't effect anything in this module, but
-        # it may cause later problems. But without this we get ugly error spew
-        # from this test.
-        sys.stderr = open(os.devnull, 'w')
-
         with utils.tempdir() as tdir:
             with open(os.path.join(tdir, 'piglit.conf'), 'w') as f:
                 f.write('[core]\nplatform=foobar')
-- 
2.5.0



More information about the Piglit mailing list