/[escript]/trunk/escriptcore/test/python/test_util_base.py
ViewVC logotype

Diff of /trunk/escriptcore/test/python/test_util_base.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6464 by jfenwick, Wed Jan 11 00:00:46 2017 UTC revision 6465 by jfenwick, Wed Jan 11 01:28:23 2017 UTC
# Line 825  class Test_util_values(unittest.TestCase Line 825  class Test_util_values(unittest.TestCase
825            
826      def get_tagged_inputL(self, rank, fs, cplx):      def get_tagged_inputL(self, rank, fs, cplx):
827          z=self.get_python_inputL(rank, cplx)          z=self.get_python_inputL(rank, cplx)
828          ref=self.get_array_inputL(rank, cplx)          ref=self.get_array_inputL(rank, cplx)[0]
829          d=Data(z, fs)          d=Data(z, fs)
830          d.tag()          d.tag()
831          return (d, ref)              return (d, ref)    
832            
833      def get_tagged_input1(self, rank, fs, cplx):      def get_tagged_input1(self, rank, fs, cplx):
834          z=self.get_python_input1(rank, cplx)          z=self.get_python_input1(rank, cplx)
835          ref=self.get_array_input1(rank, cplx)          ref=self.get_array_input1(rank, cplx)[0]
836          d=Data(z, fs)          d=Data(z, fs)
837          d.tag()          d.tag()
838          return (d, ref)          return (d, ref)
# Line 883  class Test_util_values(unittest.TestCase Line 883  class Test_util_values(unittest.TestCase
883                  expected_exceptions=(TypeError, RuntimeError)   # These are used for unsupported complex                  expected_exceptions=(TypeError, RuntimeError)   # These are used for unsupported complex
884              with self.assertRaises(Exception) as err:                with self.assertRaises(Exception) as err:  
885                  res=eval(op)                  res=eval(op)
                 print("Succeeded in evaluating "+str(op))  
                 print("For a=")  
                 print(str(a))  
886              # unfortunately, we don't return a single exception type in this case              # unfortunately, we don't return a single exception type in this case
887              self.assertTrue(type(err.exception) in expected_exceptions, "Exception was raised but it was of unexpected type ("+str(type(err.exception))+")")              self.assertTrue(type(err.exception) in expected_exceptions, "Exception was raised but it was of unexpected type ("+str(type(err.exception))+")")
888            
# Line 1125  class Test_util_values(unittest.TestCase Line 1122  class Test_util_values(unittest.TestCase
1122                  if rank in expect_raise_on_ranks or (c and not supportcplx):                  if rank in expect_raise_on_ranks or (c and not supportcplx):
1123                      dest=epars                                      dest=epars                
1124                  test=[opname+" - "+cs+"tagged rank "+str(rank),]                  test=[opname+" - "+cs+"tagged rank "+str(rank),]
1125                  (a, r)=self.get_tagged_input1(rank, self.functionspace, c)                  (a, r)=self.get_tagged_inputL(rank, self.functionspace, c)
1126                  a=input_trans(a)                  a=input_trans(a)
1127                  r=input_trans(numpy.array(r))                                  r=input_trans(numpy.array(r))
1128                  test.append(a)                  test.append(a)
1129                  test.append(expected_exceptions)                                  test.append(expected_exceptions)                
1130                  # arguments are new tagged value, operation, extra check, reference_value, reference_check                  # arguments are new tagged value, operation, extra check, reference_value, reference_check

Legend:
Removed from v.6464  
changed lines
  Added in v.6465

  ViewVC Help
Powered by ViewVC 1.1.26