Changeset 9e308a3 in sasview for test


Ignore:
Timestamp:
Sep 23, 2017 1:49:08 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
1d014cb
Parents:
d04ac05
Message:

tweak utests so it is slightly easier to identify and run failing tests

Location:
test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/run_one.py

    • Property mode changed from 100644 to 100755
  • test/utest_sasview.py

    • Property mode changed from 100644 to 100755
    r574adc7 r9e308a3  
    2525    import matplotlib 
    2626    import wx 
    27 except: 
     27except ImportError: 
    2828    HAS_MPL_WX = False 
    2929 
     
    3636#    COMMAND_SEP = '&' 
    3737 
    38 def run_tests(dirs=None, all=False): 
     38def run_tests(dirs=None, run_all=False): 
    3939    test_root = os.path.abspath(os.path.dirname(__file__)) 
    4040    run_one_py = os.path.join(test_root, 'run_one.py') 
     
    8282                    if has_failed or not has_tests: 
    8383                        failed += 1 
    84                         print("Result for %s (%s): FAILED" % (module_name, module_dir)) 
     84                        modpath = os.path.join(module_dir, module_name+".py") 
     85                        print("Result for %s: FAILED    %s" 
     86                              % (module_name, os.path.relpath(modpath, os.getcwd()))) 
    8587                        #print(std_out) 
    8688                    else: 
     
    106108 
    107109if __name__ == '__main__': 
    108     all = (len(sys.argv) > 1 and sys.argv[1] == '-all') 
    109     dirs = sys.argv[1:] if not all else sys.argv[2:] 
    110     if run_tests(dirs=dirs, all=all)>0: 
     110    run_all = (len(sys.argv) > 1 and sys.argv[1] == '-all') 
     111    dirs = sys.argv[1:] if not run_all else sys.argv[2:] 
     112    if run_tests(dirs=dirs, run_all=run_all)>0: 
    111113        sys.exit(1) 
Note: See TracChangeset for help on using the changeset viewer.