summaryrefslogtreecommitdiff
path: root/pbr/tests/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'pbr/tests/__init__.py')
-rw-r--r--pbr/tests/__init__.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/pbr/tests/__init__.py b/pbr/tests/__init__.py
index 14a5b5e..160743f 100644
--- a/pbr/tests/__init__.py
+++ b/pbr/tests/__init__.py
@@ -53,6 +53,21 @@ import testtools
from pbr import packaging
+class DiveDir(fixtures.Fixture):
+ """Dive into given directory and return back on cleanup.
+
+ :ivar path: The target directory.
+ """
+
+ def __init__(self, path):
+ self.path = path
+
+ def setUp(self):
+ super(DiveDir, self).setUp()
+ self.addCleanup(os.chdir, os.getcwd())
+ os.chdir(self.path)
+
+
class BaseTestCase(testtools.TestCase, testresources.ResourcedTestCase):
def setUp(self):