コード例 #1
0
 def test_same_error(self):
     cupy_error = Exception()
     cupy_tb = 'xxxx'
     numpy_error = Exception()
     numpy_tb = 'yyyy'
     # Nothing happens
     helper._check_cupy_numpy_error(self, cupy_error, cupy_tb, numpy_error,
                                    numpy_tb)
コード例 #2
0
ファイル: test_helper.py プロジェクト: TesterRandolph/chainer
 def test_same_error(self):
     cupy_error = Exception()
     cupy_tb = 'xxxx'
     numpy_error = Exception()
     numpy_tb = 'yyyy'
     # Nothing happens
     helper._check_cupy_numpy_error(self, cupy_error, cupy_tb,
                                    numpy_error, numpy_tb)
コード例 #3
0
ファイル: test_helper.py プロジェクト: asrlabncku/RAP
 def test_cupy_numpy_different_error(self):
     cupy_error = TypeError()
     cupy_tb = 'xxxx'
     numpy_error = ValueError()
     numpy_tb = 'yyyy'
     # Use re.S mode to ignore new line characters
     pattern = re.compile(cupy_tb + '.*' + numpy_tb, re.S)
     with six.assertRaisesRegex(self, AssertionError, pattern):
         helper._check_cupy_numpy_error(self, cupy_error, cupy_tb,
                                        numpy_error, numpy_tb)
コード例 #4
0
ファイル: test_helper.py プロジェクト: TesterRandolph/chainer
 def test_cupy_numpy_different_error(self):
     cupy_error = TypeError()
     cupy_tb = 'xxxx'
     numpy_error = ValueError()
     numpy_tb = 'yyyy'
     # Use re.S mode to ignore new line characters
     pattern = re.compile(cupy_tb + '.*' + numpy_tb, re.S)
     with self.assertRaisesRegexp(AssertionError, pattern):
         helper._check_cupy_numpy_error(self, cupy_error, cupy_tb,
                                        numpy_error, numpy_tb)
コード例 #5
0
ファイル: test_helper.py プロジェクト: TesterRandolph/chainer
 def test_forbidden_error(self):
     cupy_error = Exception()
     cupy_tb = 'xxxx'
     numpy_error = Exception()
     numpy_tb = 'yyyy'
     # Use re.S mode to ignore new line characters
     pattern = re.compile(cupy_tb + '.*' + numpy_tb, re.S)
     with self.assertRaisesRegexp(AssertionError, pattern):
         helper._check_cupy_numpy_error(
             self, cupy_error, cupy_tb,
             numpy_error, numpy_tb, accept_error=False)
コード例 #6
0
 def test_forbidden_error(self):
     cupy_error = Exception()
     cupy_tb = 'xxxx'
     numpy_error = Exception()
     numpy_tb = 'yyyy'
     # Use re.S mode to ignore new line characters
     pattern = re.compile(cupy_tb + '.*' + numpy_tb, re.S)
     with six.assertRaisesRegex(self, AssertionError, pattern):
         helper._check_cupy_numpy_error(
             self, cupy_error, cupy_tb,
             numpy_error, numpy_tb, accept_error=False)
コード例 #7
0
ファイル: test_helper.py プロジェクト: asrlabncku/RAP
 def test_numpy_error(self):
     numpy_error = Exception()
     numpy_tb = 'yyyy'
     with six.assertRaisesRegex(self, AssertionError, numpy_tb):
         helper._check_cupy_numpy_error(self, None, None, numpy_error,
                                        numpy_tb)
コード例 #8
0
ファイル: test_helper.py プロジェクト: asrlabncku/RAP
 def test_cupy_error(self):
     cupy_error = Exception()
     cupy_tb = 'xxxx'
     with six.assertRaisesRegex(self, AssertionError, cupy_tb):
         helper._check_cupy_numpy_error(self, cupy_error, cupy_tb, None,
                                        None)
コード例 #9
0
ファイル: test_helper.py プロジェクト: asrlabncku/RAP
 def test_both_success(self):
     with self.assertRaises(AssertionError):
         helper._check_cupy_numpy_error(self, None, None, None, None)
コード例 #10
0
ファイル: test_helper.py プロジェクト: TesterRandolph/chainer
 def test_numpy_error(self):
     numpy_error = Exception()
     numpy_tb = 'yyyy'
     with self.assertRaisesRegexp(AssertionError, numpy_tb):
         helper._check_cupy_numpy_error(self, None, None,
                                        numpy_error, numpy_tb)
コード例 #11
0
ファイル: test_helper.py プロジェクト: TesterRandolph/chainer
 def test_cupy_error(self):
     cupy_error = Exception()
     cupy_tb = 'xxxx'
     with self.assertRaisesRegexp(AssertionError, cupy_tb):
         helper._check_cupy_numpy_error(self, cupy_error, cupy_tb,
                                        None, None)
コード例 #12
0
ファイル: test_helper.py プロジェクト: TesterRandolph/chainer
 def test_both_success(self):
     with self.assertRaises(AssertionError):
         helper._check_cupy_numpy_error(self, None, None, None, None)