Ignore:
Timestamp:
Nov 23, 2009 11:46:06 AM (10 years ago)
Author:
wehart
Message:

Adding explicit import of PyYAML, and corresponding logic
to ignore yaml-dependent tests.

File:
1 edited

Legend:

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

    r1936 r1937  
    2020import xml
    2121import pickle
     22
     23try:
     24    import yaml
     25    yaml_available=True
     26except ImportError:
     27    yaml_available=False
     28
    2229
    2330class Test(pyutilib.th.TestCase):
     
    5158    def test_read_solution1(self):
    5259        """ Read a SolverResults Object"""
     60        if not yaml_available:
     61            return
    5362        self.results = coopr.opt.SolverResults()
    5463        self.results.read(filename=currdir+"test4_sol.txt")
     
    6069    def test_pickle_solution1(self):
    6170        """ Read a SolverResults Object"""
     71        if not yaml_available:
     72            return
    6273        self.results = coopr.opt.SolverResults()
    6374        self.results.read(filename=currdir+"test4_sol.txt")
Note: See TracChangeset for help on using the changeset viewer.