Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 10e5c25

Browse filesBrowse files
Update to ODPI-C 4.0.1 and add test to ensure that the offset is returned
correctly when a parse error is encountered.
1 parent 8d719c3 commit 10e5c25
Copy full SHA for 10e5c25

File tree

3 files changed

+12
-8
lines changed
Filter options

3 files changed

+12
-8
lines changed

‎doc/src/release_notes.rst

Copy file name to clipboardExpand all lines: doc/src/release_notes.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

‎test/Error.py

Copy file name to clipboardExpand all lines: test/Error.py
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@
1616

1717
class 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

4348
if __name__ == "__main__":
4449
TestEnv.RunTestCases()
45-

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.