Changeset 2420


Ignore:
Timestamp:
Mar 11, 2010 6:01:07 PM (9 years ago)
Author:
wehart
Message:

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

Location:
coopr.opt/trunk/coopr/opt/tests/base
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • coopr.opt/trunk/coopr/opt/tests/base/test_convert.py

    r2201 r2420  
    1212
    1313import re
    14 import unittest
    1514from nose.tools import nottest
    1615import coopr.opt
    1716from coopr.opt import ProblemFormat, ConverterError
    1817import coopr
    19 import pyutilib.th
     18import pyutilib.th as unittest
    2019import pyutilib.services
    2120import pyutilib.component.config
     
    6968
    7069
    71 class OptConvertDebug(pyutilib.th.TestCase):
     70class OptConvertDebug(unittest.TestCase):
    7271
    7372    def setUp(self):
  • coopr.opt/trunk/coopr/opt/tests/base/test_os.py

    r1918 r2420  
    1111currdir = dirname(abspath(__file__))+os.sep
    1212
    13 import unittest
    1413from nose.tools import nottest
    1514import coopr.opt
    1615import coopr
    1716import xml
    18 import pyutilib.th
     17import pyutilib.th as unittest
    1918import pyutilib.services
    2019
    2120pyutilib.services.TempfileManager.tempdir = currdir
    2221
    23 class Test(pyutilib.th.TestCase):
     22class Test(unittest.TestCase):
    2423
    2524    def setUp(self):
  • coopr.opt/trunk/coopr/opt/tests/base/test_sol.py

    r1918 r2420  
    1111currdir = dirname(abspath(__file__))+os.sep
    1212
    13 import unittest
    1413from nose.tools import nottest
    1514import coopr.opt
    1615import coopr
    1716import xml
    18 import pyutilib.th
     17import pyutilib.th as unittest
    1918import pyutilib.services
    2019
    2120
    22 class Test(pyutilib.th.TestCase):
     21class Test(unittest.TestCase):
    2322
    2423    def setUp(self):
  • coopr.opt/trunk/coopr/opt/tests/base/test_soln.py

    r2109 r2420  
    1111currdir = dirname(abspath(__file__))+os.sep
    1212
    13 import unittest
    1413from nose.tools import nottest
    1514import coopr.opt
    1615import coopr
    17 import pyutilib.th
     16import pyutilib.th as unittest
    1817import pyutilib.misc
    1918import pyutilib.services
     
    2827
    2928
    30 class Test(pyutilib.th.TestCase):
     29class Test(unittest.TestCase):
    3130
    3231    def setUp(self):
     
    5655        self.failUnlessFileEqualsBaseline(currdir+"write_solution2.txt", currdir+"test2_soln.txt")
    5756
     57    @unittest.skipIf(not yaml_available, "Cannot import 'yaml'")
    5858    def test_read_solution1(self):
    5959        """ Read a SolverResults Object"""
    60         if not yaml_available:
    61             return
    6260        self.results = coopr.opt.SolverResults()
    6361        self.results.read(filename=currdir+"test4_sol.txt")
     
    6765        self.failUnlessFileEqualsBaseline(currdir+"read_solution1.out", currdir+"test4_sol.txt")
    6866
     67    @unittest.skipIf(not yaml_available, "Cannot import 'yaml'")
    6968    def test_pickle_solution1(self):
    7069        """ Read a SolverResults Object"""
    71         if not yaml_available:
    72             return
    7370        self.results = coopr.opt.SolverResults()
    7471        self.results.read(filename=currdir+"test4_sol.txt")
Note: See TracChangeset for help on using the changeset viewer.