diff options
Diffstat (limited to 'pbr/tests/__init__.py')
-rw-r--r-- | pbr/tests/__init__.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pbr/tests/__init__.py b/pbr/tests/__init__.py index a4874c3..6c6fb59 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): |