diff options
author | Fred Drake <fdrake@acm.org> | 2000-02-07 17:15:48 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-02-07 17:15:48 (GMT) |
commit | a710d6e20cebc0d8a2aa6e8df5c37d9263d86d9b (patch) | |
tree | bbf099dda3d164f0d40aa3a48932237226f7d169 | |
parent | ef6ceb62bde8ff9ffc09df7686c3d4a50548a425 (diff) | |
download | cpython-a710d6e20cebc0d8a2aa6e8df5c37d9263d86d9b.zip cpython-a710d6e20cebc0d8a2aa6e8df5c37d9263d86d9b.tar.gz cpython-a710d6e20cebc0d8a2aa6e8df5c37d9263d86d9b.tar.bz2 |
Added test case for accessing gsbm database by key after it's closed;
it should raise gdbm.error.
-rwxr-xr-x | Lib/test/test_gdbm.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_gdbm.py b/Lib/test/test_gdbm.py index 22db6aa..030218e 100755 --- a/Lib/test/test_gdbm.py +++ b/Lib/test/test_gdbm.py @@ -5,7 +5,7 @@ import gdbm from gdbm import error -from test_support import verbose +from test_support import verbose, TestFailed filename= '/tmp/delete_me' @@ -18,6 +18,12 @@ if verbose: g.has_key('a') g.close() +try: + g['a'] +except error: + pass +else: + raise TestFailed, "expected gdbm.error accessing closed database" g = gdbm.open(filename, 'r') g.close() g = gdbm.open(filename, 'rw') |