Changeset 939 for trunk/unit_tests.py


Ignore:
Timestamp:
Jun 2, 2013 11:07:35 PM (8 years ago)
Author:
toby
Message:

fix & cleanup unit tests; add/change doc strings for sphinx; add all G2 py files to sphinx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/unit_tests.py

    r762 r939  
    66# $Id$
    77########### SVN repository information ###################
     8'''
     9*unit_tests: Self-test Module*
     10------------------------------
     11
     12A script that can be run to test a series of self-tests in GSAS-II. At present,
     13only modules ``GSASIIspc`` and ``GSASIIlattice`` have self-tests.
     14
     15'''
     16
    817import GSASIIspc
    9 import GSASIIlattice as G2l
     18import GSASIIlattice
    1019def test_GSASIIspc():
    11     GSASIIspc.test0()
    12 def test_GSASIIspc1():
    13     GSASIIspc.test1()
    14 def test_GSASIIspc2():
    15     GSASIIspc.test2()
    16 def test_GSASIIspc3():
    17     GSASIIspc.test3()
    18 def test_GSASIIlattice0():
    19     G2l.test0()
    20 def test_GSASIIlattice1():
    21     G2l.test1()
    22 def test_GSASIIlattice2():
    23     G2l.test2()
    24 def test_GSASIIlattice3():
    25     G2l.test3()
    26 def test_GSASIIlattice4():
    27     G2l.test4()
    28 def test_GSASIIlattice5():
    29     G2l.test5()
    30 def test_GSASIIlattice6():
    31     G2l.test6()
    32 def test_GSASIIlattice7():
    33     G2l.test7()
    34 def test_GSASIIlattice8():
    35     G2l.test8()
     20    '''Test registered self-tests in ``GSASIIspc``.
     21    Takes no input and returns nothing. Throws an Exception if a test fails.
     22    '''
     23    #GSASIIspc.selftestquiet = False
     24    for test in GSASIIspc.selftestlist:
     25        test()
     26def test_GSASIIlattice():
     27    '''Test registered self-tests in ``GSASIIlattice``.
     28    Takes no input and returns nothing. Throws an Exception if a test fails.
     29    '''
     30    #GSASIIlattice.selftestquiet = False
     31    for test in GSASIIlattice.selftestlist:
     32        test()
    3633
    3734if __name__ == '__main__':
    3835    test_GSASIIspc()
    39     test_GSASIIspc1()
    40     test_GSASIIspc2()
    41     test_GSASIIspc3()
    42     G2l.test0()
    43     G2l.test1()
    44     G2l.test2()
    45     G2l.test3()
    46     G2l.test4()
    47     G2l.test5()
    48     G2l.test6()
    49     G2l.test7()
    50     G2l.test8()
     36    test_GSASIIlattice()
    5137    print "OK"
Note: See TracChangeset for help on using the changeset viewer.