incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1441374 - /incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/tests/env.py
Date Fri, 01 Feb 2013 10:16:19 GMT
Author: jure
Date: Fri Feb  1 10:16:18 2013
New Revision: 1441374

URL: http://svn.apache.org/viewvc?rev=1441374&view=rev
Log:
Cleanup environment path if setUp fails


Modified:
    incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/tests/env.py

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/tests/env.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/tests/env.py?rev=1441374&r1=1441373&r2=1441374&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/tests/env.py (original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/trac/trac/tests/env.py Fri Feb  1
10:16:18 2013
@@ -13,6 +13,7 @@ class EnvironmentTestCase(unittest.TestC
 
     def setUp(self):
         env_path = os.path.join(tempfile.gettempdir(), 'trac-tempenv')
+        self.addCleanup(self.cleanupEnvPath, env_path)
         self.env = Environment(env_path, create=True)
 
     def tearDown(self):
@@ -21,6 +22,10 @@ class EnvironmentTestCase(unittest.TestC
         self.env.shutdown() # really closes the db connections
         shutil.rmtree(self.env.path)
 
+    def cleanupEnvPath(self, path):
+        if os.path.exists(path):
+            shutil.rmtree(path)
+
     def test_get_version(self):
         """Testing env.get_version"""
         assert self.env.get_version() == db_default.db_version



Mime
View raw message