Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-3904: Pytest updates #40

Merged
merged 46 commits into from
Aug 17, 2016
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
12ebd10
Auto-PEP8 createWcsWithSip.py
r-owen Aug 15, 2016
1153820
Standardize imports in createWcsWithSip.py
r-owen Aug 15, 2016
7017fd7
Modernize the way createWcsWithSip is run
r-owen Aug 15, 2016
450e53e
Auto-pep8 lsf1d.py
r-owen Aug 15, 2016
d865eee
Modernized imports in lsf1d.py
r-owen Aug 15, 2016
cf79cfa
Modernize lsf1d.py
r-owen Aug 15, 2016
b61e555
Run autopep8 on all code
r-owen Aug 15, 2016
22b5ec6
Hide testpy's cache
r-owen Aug 15, 2016
ca32e5b
Modernize imports in lsf2d.py
r-owen Aug 15, 2016
79d66e0
Modernize lsf2d.py
r-owen Aug 15, 2016
5e01949
Modernize imports in tests/openFiles.py
r-owen Aug 15, 2016
3480f92
Modernize the way openFiles.py is called
r-owen Aug 15, 2016
832db6a
Modernize asserts in testAstrometryTask.py
r-owen Aug 15, 2016
3208e05
Standardized imports in testAstrometryTask.py
r-owen Aug 15, 2016
9207f0c
Modernize the way testAstrometryTask.py is run
r-owen Aug 15, 2016
918004e
Standardize imports in testFindA...NetDataDir.py
r-owen Aug 15, 2016
346c464
Modernize how testFindA...NetDataDir.py is run
r-owen Aug 15, 2016
763e191
Modernize asserts in testFitTanSip...
r-owen Aug 15, 2016
dc99f8f
Modernize imports in testFitTanSip...
r-owen Aug 15, 2016
f52eb5d
Modernize the way testFitTanSip... is run
r-owen Aug 15, 2016
f3f5f60
Modernize imports in testFitTanSipWcsTask.py
r-owen Aug 15, 2016
a011202
Improve pytest compatibility for testFitTanSipWcsTask.py
r-owen Aug 15, 2016
9b5cd01
Modernize imports in testJoinMatchList...
r-owen Aug 15, 2016
3eccdf3
Modernize asserts in testJoinMatchList...
r-owen Aug 15, 2016
d3dc3af
Modernize the way testJoinMatchList... is run
r-owen Aug 15, 2016
044debb
Modernize imports in testLoadA...NetObj...
r-owen Aug 15, 2016
5c0f1f0
Modernize asserts
r-owen Aug 15, 2016
10245b7
Modernize the way testLoadA...NetObj... is run
r-owen Aug 15, 2016
fa79c07
Modernize imports in testMakeMatchStat...
r-owen Aug 15, 2016
4828225
Modernize the way testMakeMatchStatistics is run
r-owen Aug 15, 2016
af7cc9e
Add missing del in tearDown ticket1979
r-owen Aug 15, 2016
e603286
Modernize asserts in ticket1989
r-owen Aug 15, 2016
4048973
Modernize the way ticket1979 is run
r-owen Aug 15, 2016
51f4159
Modernize imports in testMultiIndex.py
r-owen Aug 15, 2016
2dbf7e7
Modernize asserts in testMultiIndex
r-owen Aug 15, 2016
41995ab
Modernize the way testMultiIndex is run
r-owen Aug 15, 2016
b3e898d
Modernize imports in testSetMatchDistance
r-owen Aug 15, 2016
0a46313
Modernize the way testSetMatchDistance is ru
r-owen Aug 15, 2016
90ce918
Modernize imports in testSipTransformations
r-owen Aug 15, 2016
d46b80c
Modernize the way testSipTransformations is run
r-owen Aug 15, 2016
a079ae6
Remove unwanted comment in testSipTransformations
r-owen Aug 15, 2016
b52f9fa
Use __file__ not getPackageDir in testAstrometryTask.py
r-owen Aug 15, 2016
fbd8604
Rename tests/foo.py to tests/testFoo.py
r-owen Aug 15, 2016
b65ff8f
Set ASTROMETRY_NET_DATA_DIR in setUp
r-owen Aug 15, 2016
c919566
Update testOpenFiles to restore open file limit in tearDown
r-owen Aug 16, 2016
50f45d8
py.test migration and pep8 clean up
afausti Aug 16, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 14 additions & 28 deletions tests/lsf1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@

class Lsf1dTestCase(unittest.TestCase):

def setUp(self):
pass

def tearDown(self):
pass

def testBadArgs1(self):
"""Check that code fails when order is too low"""

Expand All @@ -46,8 +40,8 @@ def testBadArgs1(self):

order = 0

self.assertRaises(lsst.pex.exceptions.Exception,
sip.LeastSqFitter1dPoly, x, y, s, order)
with self.assertRaises(lsst.pex.exceptions.Exception):
sip.LeastSqFitter1dPoly(x, y, s, order)

def testBadArgs2(self):
"""Check that code fails when not len(x) != len(y)"""
Expand All @@ -58,8 +52,8 @@ def testBadArgs2(self):

order = 0

self.assertRaises(lsst.pex.exceptions.Exception,
sip.LeastSqFitter1dPoly, x, y, s, order)
with self.assertRaises(lsst.pex.exceptions.Exception):
sip.LeastSqFitter1dPoly(x, y, s, order)

def testBadArgs3(self):
"""Check that code fails when not len(x) != len(s)"""
Expand All @@ -70,8 +64,8 @@ def testBadArgs3(self):

order = 0

self.assertRaises(lsst.pex.exceptions.Exception,
sip.LeastSqFitter1dPoly, x, y, s, order)
with self.assertRaises(lsst.pex.exceptions.Exception):
sip.LeastSqFitter1dPoly(x, y, s, order)

def testBadArgs4(self):
"""Check that code fails when not order > number data points"""
Expand All @@ -82,8 +76,8 @@ def testBadArgs4(self):

order = 5

self.assertRaises(lsst.pex.exceptions.Exception,
sip.LeastSqFitter1dPoly, x, y, s, order)
with self.assertRaises(lsst.pex.exceptions.Exception):
sip.LeastSqFitter1dPoly(x, y, s, order)

def testConst1(self):
"""Check that code fits a dc offset correctly (1)"""
Expand Down Expand Up @@ -147,23 +141,15 @@ def testCompareToCpp2(self):
self.assertAlmostEqual(lsf.valueAt(x[1]), y[1], 1)
self.assertAlmostEqual(lsf.valueAt(x[2]), y[2], 1)

#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

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

suites = []
suites += unittest.makeSuite(Lsf1dTestCase)
suites += unittest.makeSuite(lsst.utils.tests.MemoryTestCase)

return unittest.TestSuite(suites)

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

def run(exit=False):
"""Run the tests"""
lsst.utils.tests.run(suite(), exit)

if __name__ == "__main__":
run(True)
lsst.utils.tests.init()
unittest.main()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline is missing.