File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ Version 8.0 (June 2020)
1010
1111#) Dropped support for Python 2. For those still requiring Python 2, see
1212 :ref: `python2 `.
13- #) Updated embedded ODPI-C to `version 4.0
13+ #) Updated embedded ODPI-C to `version 4.0.1
1414 <https://oracle.github.io/odpi/doc/releasenotes.html#
15- version-4-0-june-25 -2020> `__.
15+ version-4-0-1- june-26 -2020> `__.
1616#) Reworked type management to clarify and simplify code
1717
1818 - Added :ref: `constants <dbtypes >` for all database types. The database
Original file line number Diff line number Diff line change 1616
1717class TestCase (TestEnv .BaseTestCase ):
1818
19+ def testParseError (self ):
20+ "test parse error returns offset correctly"
21+ with self .assertRaises (cx_Oracle .Error ) as cm :
22+ self .cursor .execute ("begin t_Missing := 5; end;" )
23+ errorObj , = cm .exception .args
24+ self .assertEqual (errorObj .offset , 6 )
25+
1926 def testPickleError (self ):
2027 "test picking/unpickling an error object"
21- errorObj = None
22- try :
28+ with self .assertRaises (cx_Oracle .Error ) as cm :
2329 self .cursor .execute ("""
2430 begin
2531 raise_application_error(-20101, 'Test!');
2632 end;""" )
27- except cx_Oracle .Error as e :
28- errorObj , = e .args
33+ errorObj , = cm .exception .args
2934 self .assertEqual (type (errorObj ), cx_Oracle ._Error )
3035 self .assertTrue ("Test!" in errorObj .message )
3136 self .assertEqual (errorObj .code , 20101 )
@@ -42,4 +47,3 @@ def testPickleError(self):
4247
4348if __name__ == "__main__" :
4449 TestEnv .RunTestCases ()
45-
You can’t perform that action at this time.
0 commit comments