Skip to content

Commit

Permalink
remove test_suite() functions from test modules: the 'python setup.py…
Browse files Browse the repository at this point in the history
… test' they are meant to support is not the way we do that anymore (according to desiutil docs)
  • Loading branch information
dstndstn committed Jul 22, 2024
1 parent e492b7d commit 80ebce4
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 82 deletions.
6 changes: 0 additions & 6 deletions py/desimodel/test/test_fastfiberacceptance.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,5 @@ def test_fastfiberacceptance(self):
val = fa.value("POINT",sigmas=np.linspace(1.0,1.5,3)*fwhm_arcsec_to_sigma_um,offsets=np.zeros(3))
assert(val.size==3)

def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)

if __name__ == '__main__':
unittest.main()
10 changes: 0 additions & 10 deletions py/desimodel/test/test_fieldrot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,3 @@ def test_angle_with_or_without_astropy(self) :
maxdiff=max(maxdiff,np.abs(angle2-angle1)*3600.)
print("Max. difference = {:3.2f} arcsec".format(maxdiff))
assert(maxdiff<10.)

def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""

# usage, in base directory of desimodel :
# python setup.py test -m desimodel.test.test_fieldrot
return unittest.defaultTestLoader.loadTestsFromName(__name__)
7 changes: 0 additions & 7 deletions py/desimodel/test/test_focalplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,3 @@ def test_gfa_coverage(self):
del targets['TARGET_DEC']
with self.assertRaises(ValueError):
ok = f.targets_on_gfa(telra, teldec, targets) #- no ra/dec

def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
8 changes: 0 additions & 8 deletions py/desimodel/test/test_footprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,3 @@ def test_spatial_real_tiles(self):

# Just interesting to see how many tiles overlap a random point?
### print(np.bincount([len(i) for i in ret]))


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m desimodel.test.test_footprint
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
6 changes: 0 additions & 6 deletions py/desimodel/test/test_healpix.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,3 @@ def test_pix2tiles(self):
for pix in tileids2pix(nside, tileid):
tiles = pix2tiles(nside, pix)
self.assertIn(tileid, tiles['TILEID'], '{} not in pix2tiles({},{})'.format(tileid, nside, pix))

def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
8 changes: 0 additions & 8 deletions py/desimodel/test/test_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,3 @@ def test_build_gfa_table(self):
gfa.build_gfa_table(testdir='.')
self.assertTrue(os.path.exists('gfa.ecsv'), "Test Failed to create a valid file!")
os.remove('gfa.ecsv')


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
7 changes: 0 additions & 7 deletions py/desimodel/test/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,3 @@ def test_install(self):
install(desimodel='/opt/desimodel')
self.assertEqual(str(e.exception), "Mock stderr")
Popen.assert_called_with(['svn', 'export', 'https://desi.lbl.gov/svn/code/desimodel/trunk/data'], stderr=-1, stdout=-1)


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
7 changes: 0 additions & 7 deletions py/desimodel/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,3 @@ def test_trim_data(self):
trim.trim_data(indir, self.trimdir)
self.assertTrue(os.path.isdir(self.trimdir))
self.assertGreater(len(list(os.walk(self.trimdir))), 1)


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
7 changes: 0 additions & 7 deletions py/desimodel/test/test_top_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,3 @@ def test_version(self):
self.assertRegex(theVersion, self.versionre)
except AttributeError:
self.assertRegexpMatches(theVersion, self.versionre)


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
8 changes: 0 additions & 8 deletions py/desimodel/test/test_trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,3 @@ def test_trim_quickpsf(self):
trim_quickpsf('/in/specpsf', '/out/specpsf', 'psf-quicksim.fits')
fits['open'].assert_called_with('/in/specpsf/psf-quicksim.fits')
fits['HDUList']().writeto.assert_called_with('/out/specpsf/psf-quicksim.fits', overwrite=True)


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)
8 changes: 0 additions & 8 deletions py/desimodel/test/test_weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,3 @@ def test_dome_frac_values(self):
replay='Y2017,Y2007')
self.assertTrue(np.all(probs[:365] == t['Y2017']))
self.assertTrue(np.all(probs[365:] == t['Y2007']))


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)

0 comments on commit 80ebce4

Please sign in to comment.