Skip to content
This repository
Browse code

[#81] Started cleaning up test directories

  • Loading branch information...
commit 3475a1c08df62f1c7c4f84d85d5a56f588ca6587 1 parent c5878e6
Lukasz Balcerzak authored October 15, 2011

Showing 1 changed file with 14 additions and 0 deletions. Show diff stats Hide diff stats

  1. 14  vcs/tests/base.py
14  vcs/tests/base.py
@@ -2,8 +2,10 @@
2 2
 Module providing backend independent mixin class. It requires that
3 3
 InMemoryChangeset class is working properly at backend class.
4 4
 """
  5
+import os
5 6
 import vcs
6 7
 import time
  8
+import shutil
7 9
 import datetime
8 10
 from vcs.utils.compat import unittest
9 11
 
@@ -78,10 +80,22 @@ def setUpClass(cls):
78 80
                 author=commit['author'],
79 81
                 date=commit['date'])
80 82
 
  83
+    @classmethod
  84
+    def tearDownClass(cls):
  85
+        if not getattr(cls, 'recreate_repo_per_test', False) and \
  86
+            'VCS_REMOVE_TEST_DIRS' in os.environ:
  87
+            shutil.rmtree(cls.repo_path)
  88
+
81 89
     def setUp(self):
82 90
         if getattr(self, 'recreate_repo_per_test', False):
83 91
             self.__class__.setUpClass()
84 92
 
  93
+    def tearDown(self):
  94
+        if getattr(self, 'recreate_repo_per_test', False) and \
  95
+            'VCS_REMOVE_TEST_DIRS' in os.environ:
  96
+            shutil.rmtree(self.repo_path)
  97
+
  98
+
85 99
 
86 100
 # For each backend create test case class
87 101
 for alias in SCM_TESTS:

0 notes on commit 3475a1c

Please sign in to comment.
Something went wrong with that request. Please try again.