diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-07-13 17:21:10 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-07-13 17:21:10 (GMT) |
commit | 7a6c733c3b8ee131d7860ecb0877837e412c2959 (patch) | |
tree | e8b739adbbce23fcb1112d02d5580953d6f3b0a2 /Lib/test | |
parent | 4a4296ec2926dd65fe4aeb4a177445606e19ffce (diff) | |
download | cpython-7a6c733c3b8ee131d7860ecb0877837e412c2959.zip cpython-7a6c733c3b8ee131d7860ecb0877837e412c2959.tar.gz cpython-7a6c733c3b8ee131d7860ecb0877837e412c2959.tar.bz2 |
Make close() identical to __del__() for a dumbdbm database. Make
closing idempotent (it used to raise a nuisance exception on the 2nd
close attempt).
Bugfix candidate? Probably, but arguable.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_dumbdbm.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_dumbdbm.py b/Lib/test/test_dumbdbm.py index 08474f7..12df673 100644 --- a/Lib/test/test_dumbdbm.py +++ b/Lib/test/test_dumbdbm.py @@ -38,6 +38,13 @@ class DumbDBMTestCase(unittest.TestCase): self.read_helper(f) f.close() + def test_close_twice(self): + f = dumbdbm.open(_fname) + f['a'] = 'b' + self.assertEqual(f['a'], 'b') + f.close() + f.close() + def test_dumbdbm_modification(self): self.init_db() f = dumbdbm.open(_fname, 'w') |