File tree 3 files changed +12
-8
lines changed
Filter options
3 files changed +12
-8
lines changed
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ Version 8.0 (June 2020)
10
10
11
11
#) Dropped support for Python 2. For those still requiring Python 2, see
12
12
:ref: `python2 `.
13
- #) Updated embedded ODPI-C to `version 4.0
13
+ #) Updated embedded ODPI-C to `version 4.0.1
14
14
<https://oracle.github.io/odpi/doc/releasenotes.html#
15
- version-4-0-june-25 -2020> `__.
15
+ version-4-0-1- june-26 -2020> `__.
16
16
#) Reworked type management to clarify and simplify code
17
17
18
18
- Added :ref: `constants <dbtypes >` for all database types. The database
Original file line number Diff line number Diff line change 16
16
17
17
class TestCase (TestEnv .BaseTestCase ):
18
18
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
+
19
26
def testPickleError (self ):
20
27
"test picking/unpickling an error object"
21
- errorObj = None
22
- try :
28
+ with self .assertRaises (cx_Oracle .Error ) as cm :
23
29
self .cursor .execute ("""
24
30
begin
25
31
raise_application_error(-20101, 'Test!');
26
32
end;""" )
27
- except cx_Oracle .Error as e :
28
- errorObj , = e .args
33
+ errorObj , = cm .exception .args
29
34
self .assertEqual (type (errorObj ), cx_Oracle ._Error )
30
35
self .assertTrue ("Test!" in errorObj .message )
31
36
self .assertEqual (errorObj .code , 20101 )
@@ -42,4 +47,3 @@ def testPickleError(self):
42
47
43
48
if __name__ == "__main__" :
44
49
TestEnv .RunTestCases ()
45
-
You can’t perform that action at this time.
0 commit comments