Commit e424b220 authored by maruel@chromium.org's avatar maruel@chromium.org

Make TrialDirMixIn so it can be used stand alone.

This will be used in commit queue tests.

R=dpranke@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7046110

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@88986 0039d316-1c4b-4281-b951-d872f2087c98
parent 69eaecb3
......@@ -65,8 +65,7 @@ class TrialDir(object):
logging.error('Leaking %s' % TrialDir.TRIAL_ROOT)
class TestCase(unittest.TestCase):
"""Base unittest class that cleans off a trial directory in tearDown()."""
class TrialDirMixIn(object):
def setUp(self):
# Create a specific directory just for the test.
self.trial = TrialDir(self.id())
......@@ -80,6 +79,17 @@ class TestCase(unittest.TestCase):
return self.trial.root_dir
class TestCase(unittest.TestCase, TrialDirMixIn):
"""Base unittest class that cleans off a trial directory in tearDown()."""
def setUp(self):
unittest.TestCase.setUp(self)
TrialDirMixIn.setUp(self)
def tearDown(self):
TrialDirMixIn.tearDown(self)
unittest.TestCase.tearDown(self)
if '-l' in sys.argv:
# See SHOULD_LEAK definition in TrialDir for its purpose.
TrialDir.SHOULD_LEAK = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment