Skip to content

Commit

Permalink
Update testButler.py for py.test
Browse files Browse the repository at this point in the history
  • Loading branch information
r-owen committed Sep 30, 2016
1 parent 9ea9a5c commit 8372b0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
21 changes: 7 additions & 14 deletions tests/testButler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
import unittest
import warnings
from lsst.utils import getPackageDir
import lsst.utils.tests as utilsTests
import lsst.utils.tests
import lsst.daf.persistence as dafPersist
import lsst.afw.cameraGeom as cameraGeom
import lsst.afw.cameraGeom.utils as cameraGeomUtils
import lsst.pex.exceptions as pexExcept
import lsst.utils.tests
from lsst.daf.base import DateTime
from lsst.afw.image import RotType_UNKNOWN
from lsst.afw.coord import IcrsCoord, Coord
Expand Down Expand Up @@ -161,22 +160,16 @@ def testPackageName(self):
self.assertEqual(name, "obs_cfht")


def suite():
"""Returns a suite containing all the test cases in this module."""

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

suites = []
suites += unittest.makeSuite(GetRawTestCase)
suites += unittest.makeSuite(utilsTests.MemoryTestCase)
return unittest.TestSuite(suites)

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

def run(shouldExit=False):
"""Run the tests"""
utilsTests.run(suite(), shouldExit)

if __name__ == "__main__":
if "--display" in sys.argv:
display = True
run(True)
lsst.utils.tests.init()
unittest.main()
7 changes: 5 additions & 2 deletions tests/testColorterms.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import lsst.utils.tests
import lsst.pipe.tasks.photoCal as photoCal

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

class ColortermOverrideTestCase(unittest.TestCase):

Expand All @@ -51,6 +49,11 @@ def testColorterms(self):
self.assertIsInstance(ct.c1, numbers.Number)
self.assertIsInstance(ct.c2, numbers.Number)


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


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

Expand Down

0 comments on commit 8372b0e

Please sign in to comment.