diff options
author | Guido van Rossum <guido@python.org> | 2007-03-28 21:02:43 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-03-28 21:02:43 (GMT) |
commit | 782ff275b8c459ddab19faf0323787c223409a3a (patch) | |
tree | 14b35c9807270b055764d01a5721358888f15e65 /Lib/bsddb/test/test_basics.py | |
parent | cef2098cfa01b7dac92fece89fcb7d3439454061 (diff) | |
download | cpython-782ff275b8c459ddab19faf0323787c223409a3a.zip cpython-782ff275b8c459ddab19faf0323787c223409a3a.tar.gz cpython-782ff275b8c459ddab19faf0323787c223409a3a.tar.bz2 |
Fix errors in bsddb3 tests due to removal of exception slicing.
(There was also a segfault but it disappeared when the tests
stopped erroring out; I presume the segfault is a pre-existing
problem somewhere in a destructor.)
Diffstat (limited to 'Lib/bsddb/test/test_basics.py')
-rw-r--r-- | Lib/bsddb/test/test_basics.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index a9d7be0..381e2ff 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -163,7 +163,7 @@ class BasicTestCase(unittest.TestCase): try: d.delete('abcd') except db.DBNotFoundError as val: - assert val[0] == db.DB_NOTFOUND + assert val.args[0] == db.DB_NOTFOUND if verbose: print(val) else: self.fail("expected exception") @@ -182,7 +182,7 @@ class BasicTestCase(unittest.TestCase): try: d.put('abcd', 'this should fail', flags=db.DB_NOOVERWRITE) except db.DBKeyExistError as val: - assert val[0] == db.DB_KEYEXIST + assert val.args[0] == db.DB_KEYEXIST if verbose: print(val) else: self.fail("expected exception") @@ -315,7 +315,7 @@ class BasicTestCase(unittest.TestCase): rec = c.next() except db.DBNotFoundError as val: if get_raises_error: - assert val[0] == db.DB_NOTFOUND + assert val.args[0] == db.DB_NOTFOUND if verbose: print(val) rec = None else: @@ -335,7 +335,7 @@ class BasicTestCase(unittest.TestCase): rec = c.prev() except db.DBNotFoundError as val: if get_raises_error: - assert val[0] == db.DB_NOTFOUND + assert val.args[0] == db.DB_NOTFOUND if verbose: print(val) rec = None else: @@ -358,7 +358,7 @@ class BasicTestCase(unittest.TestCase): try: n = c.set('bad key') except db.DBNotFoundError as val: - assert val[0] == db.DB_NOTFOUND + assert val.args[0] == db.DB_NOTFOUND if verbose: print(val) else: if set_raises_error: @@ -372,7 +372,7 @@ class BasicTestCase(unittest.TestCase): try: n = c.get_both('0404', 'bad data') except db.DBNotFoundError as val: - assert val[0] == db.DB_NOTFOUND + assert val.args[0] == db.DB_NOTFOUND if verbose: print(val) else: if get_raises_error: @@ -401,7 +401,7 @@ class BasicTestCase(unittest.TestCase): rec = c.current() except db.DBKeyEmptyError as val: if get_raises_error: - assert val[0] == db.DB_KEYEMPTY + assert val.args[0] == db.DB_KEYEMPTY if verbose: print(val) else: self.fail("unexpected DBKeyEmptyError") @@ -446,7 +446,7 @@ class BasicTestCase(unittest.TestCase): # a bug may cause a NULL pointer dereference... getattr(c, method)(*args) except db.DBError as val: - assert val[0] == 0 + assert val.args[0] == 0 if verbose: print(val) else: self.fail("no exception raised when using a buggy cursor's" |