From a710d6e20cebc0d8a2aa6e8df5c37d9263d86d9b Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Mon, 7 Feb 2000 17:15:48 +0000 Subject: Added test case for accessing gsbm database by key after it's closed; it should raise gdbm.error. --- Lib/test/test_gdbm.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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') -- cgit v0.12