diff options
author | Bob Halley <halley@nominum.com> | 2009-06-19 10:11:57 +0100 |
---|---|---|
committer | Bob Halley <halley@nominum.com> | 2009-06-19 10:11:57 +0100 |
commit | 8e0352386e44aaa03667ef8ce8478164c010b8a7 (patch) | |
tree | ef1409ecbcd82f2b5a0f43785b705764323c0194 | |
parent | 2c1a8455262cb045e3e212e7ccb05aaad6439482 (diff) | |
download | dnspython-8e0352386e44aaa03667ef8ce8478164c010b8a7.tar.gz |
Add option to keep test output
-rw-r--r-- | tests/zone.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/zone.py b/tests/zone.py index 01136d1..ad7a625 100644 --- a/tests/zone.py +++ b/tests/zone.py @@ -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): |