import os
import tempfile
import shutil
from unittest import TestCase

class TmpContextBase(TestCase):
    def setUp(self):
        self.cwd = os.getcwd()
        self.d = tempfile.mkdtemp()
        os.chdir(self.d)

    def tearDown(self):
        shutil.rmtree(self.d)

@@ -256,16 +256,43 @@
 .rmtree(self.d)%0A
+        os.chdir(self.cwd)%0A

fix test tearDown.