|
|
@ -65,8 +65,7 @@ class TrialDir(object):
|
|
|
|
logging.error('Leaking %s' % TrialDir.TRIAL_ROOT)
|
|
|
|
logging.error('Leaking %s' % TrialDir.TRIAL_ROOT)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestCase(unittest.TestCase):
|
|
|
|
class TrialDirMixIn(object):
|
|
|
|
"""Base unittest class that cleans off a trial directory in tearDown()."""
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
def setUp(self):
|
|
|
|
# Create a specific directory just for the test.
|
|
|
|
# Create a specific directory just for the test.
|
|
|
|
self.trial = TrialDir(self.id())
|
|
|
|
self.trial = TrialDir(self.id())
|
|
|
@ -80,6 +79,17 @@ class TestCase(unittest.TestCase):
|
|
|
|
return self.trial.root_dir
|
|
|
|
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:
|
|
|
|
if '-l' in sys.argv:
|
|
|
|
# See SHOULD_LEAK definition in TrialDir for its purpose.
|
|
|
|
# See SHOULD_LEAK definition in TrialDir for its purpose.
|
|
|
|
TrialDir.SHOULD_LEAK = True
|
|
|
|
TrialDir.SHOULD_LEAK = True
|
|
|
|