Skip to content

Commit

Permalink
del butler. remove dir in a separate function
Browse files Browse the repository at this point in the history
  • Loading branch information
n8pease committed Jun 2, 2017
1 parent d7760a4 commit 3ef808b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/butlerProxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,18 @@ class ButlerProxyTestCase(unittest.TestCase):
inputDir = os.path.join(ROOT, 'root')
outputDir = os.path.join(ROOT, 'ButlerProxyTestCase')

def removeTestDir(self):
if os.path.exists(self.outputDir):
shutil.rmtree(self.outputDir)

def setUp(self):
self.tearDown()
self.removeTestDir()
self.butler = dafPersist.Butler(self.inputDir,
outPath=os.path.join(self.outputDir, "proxyOut"))

def tearDown(self):
if os.path.exists(self.outputDir):
shutil.rmtree(self.outputDir)
del self.butler
self.removeTestDir()

def testCheckProxy(self):
"""Attempt to cycle a DateTime object through the butler
Expand Down Expand Up @@ -98,13 +102,15 @@ def testCheckProxy(self):
self.assertIsInstance(dt, dafPersist.readProxy.ReadProxy)
self.assertFalse(isValidDateTime(dt))


class TestMemory(lsst.utils.tests.MemoryTestCase):
pass


def setup_module(module):
lsst.utils.tests.init()


if __name__ == "__main__":
lsst.utils.tests.init()
unittest.main()

0 comments on commit 3ef808b

Please sign in to comment.