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__.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/pbr/tests/__init__.py b/pbr/tests/__init__.py
index 14a5b5e..8cffb4e 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):
@@ -113,5 +128,6 @@ class BaseTestCase(testtools.TestCase, testresources.ResourcedTestCase):
stderr=subprocess.PIPE)
streams = tuple(s.decode('latin1').strip() for s in p.communicate())
- print(streams)
+ for line in streams:
+ print(line)
return (streams) + (p.returncode,)