From 9c08059110a62a926128c5f2ec0b726ef1083822 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 15 Oct 2014 12:46:51 -0700 Subject: testsuite: capture stderr by default This quiets down a lot of tests, especially for option parsing. --- testsuite/common.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'testsuite/common.py') diff --git a/testsuite/common.py b/testsuite/common.py index 5a08f8db5..49579d7ef 100644 --- a/testsuite/common.py +++ b/testsuite/common.py @@ -119,6 +119,19 @@ class Bcfg2TestCase(TestCase): :func:`assertXMLEqual`, a useful assertion method given all the XML used by Bcfg2. """ + capture_stderr = True + + @classmethod + def setUpClass(cls): + cls._stderr = sys.stderr + if cls.capture_stderr: + sys.stderr = sys.stdout + + @classmethod + def tearDownClass(cls): + if cls.capture_stderr: + sys.stderr = cls._stderr + def assertXMLEqual(self, el1, el2, msg=None): """ Test that the two XML trees given are equal. """ if msg is None: -- cgit v1.2.3-1-g7c22