Changeset 2432


Ignore:
Timestamp:
Mar 12, 2010 3:42:15 AM (9 years ago)
Author:
wehart
Message:

Merged revisions 2390-2431 via svnmerge from
https://software.sandia.gov/svn/public/coopr/coopr.plugins/trunk

........

r2421 | wehart | 2010-03-11 16:01:08 -0700 (Thu, 11 Mar 2010) | 3 lines


Rework of unit tests to (a) import pyutilib.th as 'unittest' and
(b) employ test skipping.

........

r2429 | wehart | 2010-03-11 23:38:11 -0700 (Thu, 11 Mar 2010) | 2 lines


Reworking class decorators.

........

Location:
coopr.plugins/stable/2.3
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • coopr.plugins/stable/2.3

  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/test_asl.py

    r2314 r2432  
    1111currdir = dirname(abspath(__file__))+os.sep
    1212
    13 import unittest
    1413from nose.tools import nottest
    15 import pyutilib.th
     14import pyutilib.th as unittest
    1615import pyutilib.services
    1716import pyutilib.common
     
    3635
    3736
    38 class mock_all(pyutilib.th.TestCase):
     37class mock_all(unittest.TestCase):
    3938
    4039    def setUp(self):
     
    157156class mip_all(mock_all):
    158157
    159     def run(self, result=None):
    160         global cplexamp_available
    161         if not cplexamp_available:
    162            return
    163         mock_all.run(self,result)
    164 
    165158    def setUp(self):
    166159        self.do_setup(True)
    167160
     161mip_all = unittest.skipIf(not cplexamp_available, "The 'cplexamp' command is not available")(mip_all)
    168162
    169163if __name__ == "__main__":
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/test_cbc.py

    r2356 r2432  
    1111currdir = dirname(abspath(__file__))+os.sep
    1212
    13 import pyutilib.th
     13import pyutilib.th as unittest
    1414import pyutilib.common
    1515import pyutilib.services
    16 import unittest
    1716from nose.tools import nottest
    1817import coopr.plugins.mip
     
    3837
    3938
    40 class mock_all(pyutilib.th.TestCase):
     39class mock_all(unittest.TestCase):
    4140
    4241    def setUp(self):
     
    158157class mip_all(mock_all):
    159158
    160     def run(self, result=None):
    161         """
    162         Run the same tests, but only if CBC is available
    163         """
    164         global cbc_available
    165         if not cbc_available:
    166            return
    167         mock_all.run(self,result)
    168 
    169159    def setUp(self):
    170160        self.do_setup(True)
     
    178168        #os.remove(currdir+"test_solve1a.soln")
    179169
     170mip_all = unittest.skipIf(not cbc_available, "The 'cbc' command is not available")(mip_all)
    180171
    181172if __name__ == "__main__":
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/test_convert.py

    r2314 r2432  
    1212
    1313import re
    14 import unittest
    1514from nose.tools import nottest
    1615import coopr.plugins
    1716from coopr.opt import ProblemFormat, ConverterError
    1817import coopr
    19 import pyutilib.th
     18import pyutilib.th as unittest
    2019import pyutilib.services
    2120import pyutilib.common
     
    7271
    7372
    74 class Test(pyutilib.th.TestCase):
     73class Test(unittest.TestCase):
    7574
    7675    def setUp(self):
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/test_cplex.py

    r2314 r2432  
    1111currdir = dirname(abspath(__file__))+os.sep
    1212
    13 import unittest
    1413from nose.tools import nottest
    15 import pyutilib.th
     14import pyutilib.th as unittest
    1615import pyutilib.services
    1716import pyutilib.common
     
    3534
    3635
    37 class mock_all(pyutilib.th.TestCase):
     36class mock_all(unittest.TestCase):
    3837
    3938    def setUp(self):
     
    156155class mip_all(mock_all):
    157156
    158     def run(self, result=None):
    159         global cplex_available
    160         if not cplex_available:
    161            return
    162         mock_all.run(self,result)
    163 
    164157    def setUp(self):
    165158        self.do_setup(True)
    166159
     160mip_all = unittest.skipIf(not cplex_available, "The CPLEX solver is not available")(mip_all)
    167161
    168162if __name__ == "__main__":
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/test_glpk.py

    r2390 r2432  
    1111currdir = dirname(abspath(__file__))+os.sep
    1212
    13 import pyutilib.th
     13import pyutilib.th as unittest
    1414import pyutilib.common
    1515import pyutilib.services
    16 import unittest
    1716from nose.tools import nottest
    1817import coopr.plugins.mip
     
    4140
    4241
    43 class mock_all(pyutilib.th.TestCase):
     42class mock_all(unittest.TestCase):
    4443
    4544    def setUp(self):
     
    167166class mip_all(mock_all):
    168167
    169     def run(self, result=None):
    170         """
    171         Run the same tests, but only if GLPK is available
    172         """
    173         global glpk_available
    174         if not glpk_available:
    175            return
    176         mock_all.run(self,result)
    177 
    178168    def setUp(self):
    179169        self.do_setup(True)
     
    189179            os.remove(currdir+"glpk.soln")
    190180
     181mip_all = unittest.skipIf(not glpk_available, "The 'glpsol' command is not available")(mip_all)
    191182
    192183if __name__ == "__main__":
  • coopr.plugins/stable/2.3/coopr/plugins/tests/mip/test_pico.py

    r2314 r2432  
    1111currdir = dirname(abspath(__file__))+os.sep
    1212
    13 import unittest
    1413from nose.tools import nottest
    15 import pyutilib.th
     14import pyutilib.th as unittest
    1615import pyutilib.common
    1716import pyutilib.services
     
    3736
    3837
    39 class mock_all(pyutilib.th.TestCase):
     38class mock_all(unittest.TestCase):
    4039
    4140    def setUp(self):
     
    156155class mip_all(mock_all):
    157156
    158     def run(self, result=None):
    159         global pico_available
    160         if not pico_available:
    161            return
    162         mock_all.run(self,result)
    163 
    164157    def setUp(self):
    165158        self.do_setup(True)
    166159
     160mip_all = unittest.skipIf(not pico_available, "The PICO solver is not available")(mip_all)
    167161
    168162if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.