changeset 122:0dafd12f6f5f

Only run unit tests for BDB XML backend if it's installed.
author cmlenz
date Mon, 08 Aug 2005 16:33:12 +0000
parents 381233a91db6
children cccfa117e344
files bitten/tests/recipe.py bitten/tests/store.py
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/tests/recipe.py
+++ b/bitten/tests/recipe.py
@@ -33,6 +33,7 @@
         self.recipe_xml = open(os.path.join(self.temp_dir, 'recipe.xml'), 'w')
 
     def tearDown(self):
+        self.recipe_xml.close()
         os.unlink(os.path.join(self.temp_dir, 'recipe.xml'))
 
     def test_description(self):
--- a/bitten/tests/store.py
+++ b/bitten/tests/store.py
@@ -20,6 +20,7 @@
 
 import os
 import shutil
+import sys
 import tempfile
 import unittest
 
@@ -63,4 +64,9 @@
 
 
 def suite():
-    return unittest.makeSuite(BDBXMLBackendTestCase, 'test')
+    try:
+        import dbxml
+        return unittest.makeSuite(BDBXMLBackendTestCase, 'test')
+    except ImportError:
+        print>>sys.stderr, 'Skipping unit tests for BDB XML backend'
+    return unittest.TestSuite()
Copyright (C) 2012-2017 Edgewall Software