]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Add option to keep test output
authorBob Halley <halley@nominum.com>
Fri, 19 Jun 2009 09:11:57 +0000 (10:11 +0100)
committerBob Halley <halley@nominum.com>
Fri, 19 Jun 2009 09:11:57 +0000 (10:11 +0100)
tests/zone.py

index 01136d19c8a91932736642308687a6dd757360bb..ad7a625a6512b102d98a4ecd1458aa539d92e129 100644 (file)
@@ -95,6 +95,8 @@ ns1 1d1s a 10.0.0.1
 ns2 1w1D1h1m1S a 10.0.0.2
 """
 
+_keep_output = False
+
 class ZoneTestCase(unittest.TestCase):
 
     def testFromFile1(self):
@@ -104,7 +106,8 @@ class ZoneTestCase(unittest.TestCase):
             z.to_file('example1.out', nl='\x0a')
             ok = filecmp.cmp('example1.out', 'example1.good')
         finally:
-            os.unlink('example1.out')
+            if not _keep_output:
+                os.unlink('example1.out')
         self.failUnless(ok)
 
     def testFromFile2(self):
@@ -114,7 +117,8 @@ class ZoneTestCase(unittest.TestCase):
             z.to_file('example2.out', relativize=False, nl='\x0a')
             ok = filecmp.cmp('example2.out', 'example2.good')
         finally:
-            os.unlink('example2.out')
+            if not _keep_output:
+                os.unlink('example2.out')
         self.failUnless(ok)
 
     def testFromText(self):