Changeset 574adc7 in sasview for test


Ignore:
Timestamp:
Sep 22, 2017 2:01:32 PM (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:
34d7b35
Parents:
9706d88
Message:

convert sascalc to python 2/3 syntax

Location:
test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • test/sasdataloader/test/utest_abs_reader.py

    rae69c690 r574adc7  
    224224                _found2 = True 
    225225 
    226         if _found1 == False or _found2 == False: 
    227             raise RuntimeError, "Could not find all data %s %s" % (_found1, _found2) 
     226        if not _found1 or not _found2: 
     227            raise RuntimeError("Could not find all data %s %s" 
     228                               % (_found1, _found2)) 
    228229 
    229230        # Detector 
     
    269270                    _found_term1 = True 
    270271 
    271         if _found_term1 == False or _found_term2 == False: 
    272             raise RuntimeError, "Could not find all process terms %s %s" % (_found_term1, _found_term2) 
     272        if not _found_term1 or not _found_term2: 
     273            raise RuntimeError("Could not find all process terms %s %s" 
     274                               % (_found_term1, _found_term2)) 
    273275 
    274276    def test_writer(self): 
  • test/sasdataloader/test/utest_cansas.py

    r17e257b5 r574adc7  
    22    Unit tests for the new recursive cansas reader 
    33""" 
     4import os 
     5import sys 
     6import StringIO 
     7import unittest 
     8import logging 
     9import warnings 
     10 
     11from lxml import etree 
     12from lxml.etree import XMLSyntaxError 
     13from xml.dom import minidom 
     14 
    415import sas.sascalc.dataloader.readers.cansas_reader as cansas 
    516from sas.sascalc.dataloader.loader import Loader 
     
    819from sas.sascalc.dataloader.readers.cansas_reader import Reader 
    920from sas.sascalc.dataloader.readers.cansas_constants import CansasConstants 
    10  
    11 import os 
    12 import sys 
    13 import urllib2 
    14 import StringIO 
    15 import pylint as pylint 
    16 import unittest 
    17 import numpy as np 
    18 import logging 
    19 import warnings 
    20  
    21 from lxml import etree 
    22 from lxml.etree import XMLSyntaxError 
    23 from xml.dom import minidom 
    2421 
    2522logger = logging.getLogger(__name__) 
     
    309306 
    310307if __name__ == '__main__': 
    311     unittest.main()     
     308    unittest.main() 
  • test/utest_sasview.py

    rbe51cf6 r574adc7  
    6262                    proc = subprocess.Popen(code, shell=True, stdout=subprocess.PIPE, stderr = subprocess.STDOUT) 
    6363                    std_out, std_err = proc.communicate() 
     64                    std_out, std_err = std_out.decode(), (std_err.decode() if std_err else None) 
    6465                    #print(">>>>>> standard out", file_path, "\n", std_out, "\n>>>>>>>>> end stdout", file_path) 
    6566                    #sys.exit() 
     
    109110    if run_tests(dirs=dirs, all=all)>0: 
    110111        sys.exit(1) 
    111  
Note: See TracChangeset for help on using the changeset viewer.