[augeas-devel] [PATCH 1/2] Make unit tests more quiet

Francis Giraldeau francis.giraldeau at gmail.com
Wed Mar 16 00:38:11 UTC 2011


The test test03PrintAll outputs about 15k lines on stderr and it interleave
with other test results. We redirect the printing into it's own file to avoid
this.
---
 test/test_augeas.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/test/test_augeas.py b/test/test_augeas.py
index 1bc38fe..2e9bba4 100644
--- a/test/test_augeas.py
+++ b/test/test_augeas.py
@@ -49,12 +49,14 @@ class TestAugeas(unittest.TestCase):
 
     def test03PrintAll(self):
         "print all tree elements"
+        output = open("test03PrintAll.out", "w")
         a = augeas.Augeas(root=MYROOT)
         path = "/"
         matches = recurmatch(a, path)
         for (p, attr) in matches:
-            print >> sys.stderr, p, attr
+            print >> output, p, attr
             self.failUnless(p != None and attr != None)
+        output.close()
 
     def test04Grub(self):
         "test default setting of grub entry"
-- 
1.7.1




More information about the augeas-devel mailing list