source: coopr.pyomo/stable/2.3/coopr/pyomo/tests/examples/test_amplbook2.py @ 2433

Last change on this file since 2433 was 2433, checked in by wehart, 11 years ago

Merged revisions 2388-2432 via svnmerge from
https://software.sandia.gov/svn/public/coopr/coopr.pyomo/trunk

........

r2399 | wehart | 2010-02-24 11:36:56 -0700 (Wed, 24 Feb 2010) | 2 lines


Adding a work-around when pstats cannot be imported.

........

r2400 | wehart | 2010-02-24 14:51:08 -0700 (Wed, 24 Feb 2010) | 2 lines


Misc documentation updates.

........

r2408 | wehart | 2010-02-28 05:41:04 -0700 (Sun, 28 Feb 2010) | 3 lines


Allow an earlier version of Python. I'm still not sure this is a good idea,
but it's necessary for Jython.

........

r2409 | wehart | 2010-02-28 05:42:33 -0700 (Sun, 28 Feb 2010) | 7 lines


Rework of profiling imports.


Refinement of Pyomo command-line parsing, which is more
specific now.


Adding automatic import of pyomo to package.

........

r2415 | jwatson | 2010-03-08 20:53:13 -0700 (Mon, 08 Mar 2010) | 3 lines


Significantly improved performance of PyomoModel? _clear_attribute method, mainly by eliminate unnecessary calls to it through _setattr_exec_.

........

r2416 | jwatson | 2010-03-09 16:45:22 -0700 (Tue, 09 Mar 2010) | 5 lines


Modified the AMPL dat file parser to instantiate the lexer and yaccer objects only once, for the lifetime of the module.


They were being inadvertently created at each invocation, which pyomo users wouldn't notice. But PySP users, who can be creating 1K or more instances, do!

........

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


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

........

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


Reworking class decorators.

........

File size: 840 bytes
Line 
1#
2# Unit Tests for complete examples
3#
4
5import os
6import sys
7from os.path import abspath, dirname
8topdir = dirname(dirname(abspath(__file__)))+os.sep+".."+os.sep+".."
9sys.path.insert(0, topdir)
10currdir = dirname(abspath(__file__))+os.sep
11
12from coopr.pyomo import *
13import pyutilib.th as unittest
14import glob
15
16class TestAmplbook2(unittest.TestCase): pass
17
18#
19# DISABLED FOR NOW ... Revisit these when the ipconvert utility is stable...
20#
21
22#data_dir=topdir+os.sep+"examples"+os.sep+"pyomo"+os.sep+"amplbook2"+os.sep
23#files = glob.glob(data_dir+"*.py")
24#for file in files:
25#    bname=os.path.basename(file)
26#    name=bname.split('.')[0]
27#    TestAmplbook2.add_commandline_test(cmd="cd "+data_dir+"; "+topdir+os.sep+"scripts/pyomo "+bname+" "+name+".dat", baseline=data_dir+name+".log", name=name)
28
29if __name__ == "__main__":
30   unittest.main()
Note: See TracBrowser for help on using the repository browser.