diff options
| author | Josh Kearney <josh@jk0.org> | 2013-01-22 11:09:11 -0600 |
|---|---|---|
| committer | Josh Kearney <josh@jk0.org> | 2013-01-22 12:16:09 -0600 |
| commit | 63c8bb5306d15c7679b2cd1d22b6ee556967863d (patch) | |
| tree | 3ffa74771e9c85cd9023ce5294147bb633d3cea2 /tests | |
| parent | c1ea2989049c102fde0ea22ac06d066a34d7b0db (diff) | |
| download | python-openstackclient-63c8bb5306d15c7679b2cd1d22b6ee556967863d.tar.gz | |
Migrate from nose to testr.
Run tests with testr for parallel execution.
Part of blueprint grizzly-testtools.
Change-Id: I560592186f2f440049a451a32e58067262ab62d0
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/utils.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/utils.py b/tests/utils.py index 633442c9..90274725 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,17 +1,20 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 - -import time +import os +import fixtures import testtools class TestCase(testtools.TestCase): - def setUp(self): super(TestCase, self).setUp() - self._original_time = time.time - time.time = lambda: 1234 + if (os.environ.get("OS_STDOUT_NOCAPTURE") == "True" and + os.environ.get("OS_STDOUT_NOCAPTURE") == "1"): + stdout = self.useFixture(fixtures.StringStream("stdout")).stream + self.useFixture(fixtures.MonkeyPatch("sys.stdout", stdout)) + if (os.environ.get("OS_STDERR_NOCAPTURE") == "True" and + os.environ.get("OS_STDERR_NOCAPTURE") == "1"): + stderr = self.useFixture(fixtures.StringStream("stderr")).stream + self.useFixture(fixtures.MonkeyPatch("sys.stderr", stderr)) def tearDown(self): - time.time = self._original_time super(TestCase, self).tearDown() |
