Changeset ff99eae in flex_extract.git for python/test_suite.py


Ignore:
Timestamp:
Jun 1, 2018, 8:34:59 PM (6 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
e1228f3
Parents:
ccab809
Message:

completed application of pep8 style guide and pylint investigations. added documentation almost everywhere

File:
1 moved

Legend:

Unmodified
Added
Removed
  • python/test_suite.py

    r991df6a rff99eae  
    22# -*- coding: utf-8 -*-
    33#************************************************************************
    4 # TODO AP
    5 #
     4# ToDo AP
    65# - provide more tests
    76# - provide more documentation
    8 # -
    97#************************************************************************
    108
     
    2826# @Program Functionality:
    2927#    This script triggers the ECMWFDATA test suite. Call with
    30 #    testsuite.py [test group]
     28#    test_suite.py [test group]
    3129#
    3230# @Program Content:
     
    4644# ------------------------------------------------------------------------------
    4745try:
    48     taskfile = open('testsuite.json')
    49 except:
    50     print 'could not open suite definition file testsuite.json'
     46    taskfile = open('test_suite.json')
     47except IOError:
     48    print 'could not open suite definition file test_suite.json'
    5149    exit()
    5250
     
    7371    try:
    7472        tk, tv = g, tasks[g]
    75     except:
    76         continue
     73    finally:
     74        pass
    7775    garglist = []
    7876    for ttk, ttv in tv.iteritems():
     
    8078            if ttk != 'script':
    8179                garglist.append('--' + ttk)
    82                 if '$' == ttv[0]:
     80                if ttv[0] == '$':
    8381                    garglist.append(os.path.expandvars(ttv))
    8482                else:
     
    8987            for tttk, tttv in ttv.iteritems():
    9088                if isinstance(tttv, basestring):
    91                         arglist.append('--' + tttk)
    92                         if '$' in tttv[0]:
    93                             arglist.append(os.path.expandvars(tttv))
    94                         else:
    95                             arglist.append(tttv)
     89                    arglist.append('--' + tttk)
     90                    if '$' in tttv[0]:
     91                        arglist.append(os.path.expandvars(tttv))
     92                    else:
     93                        arglist.append(tttv)
    9694            print 'Command: ', ' '.join([tv['script']] + garglist + arglist)
    9795            o = '../test/' + tk + '_' + ttk + '_' + '_'.join(ttv.keys())
     
    10199                p = subprocess.check_call([tv['script']] + garglist + arglist,
    102100                                          stdout=f, stderr=f)
    103             except:
     101            except subprocess.CalledProcessError as e:
    104102                f.write('\nFAILED\n')
    105103                print 'FAILED'
     
    111109print str(jobcounter-jobfailed) + ' successful, ' + str(jobfailed) + ' failed'
    112110print 'If tasks have been submitted via ECACCESS please check emails'
    113 
    114 #print tasks
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG