Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 415bc46 commit 6592d7fCopy full SHA for 6592d7f
1 file changed
Lib/test/test_dbm.py
@@ -75,10 +75,8 @@ def test_anydbm_creation(self):
75
def test_anydbm_creation_n_file_exists_with_invalid_contents(self):
76
# create an empty file
77
test.support.create_empty_file(_fname)
78
-
79
- f = dbm.open(_fname, 'n')
80
- self.addCleanup(f.close)
81
- self.assertEqual(len(f), 0)
+ with dbm.open(_fname, 'n') as f:
+ self.assertEqual(len(f), 0)
82
83
def test_anydbm_modification(self):
84
self.init_db()
0 commit comments