aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_dbm.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_dbm.py')
-rw-r--r--Lib/test/test_dbm.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py
index 7e8d78b8940..ae9faabd536 100644
--- a/Lib/test/test_dbm.py
+++ b/Lib/test/test_dbm.py
@@ -274,7 +274,8 @@ class WhichDBTestCase(unittest.TestCase):
@unittest.skipUnless(ndbm, reason='Test requires ndbm')
def test_whichdb_ndbm(self):
# Issue 17198: check that ndbm which is referenced in whichdb is defined
- with open(_fname + '.db', 'wb'): pass
+ with open(_fname + '.db', 'wb') as f:
+ f.write(b'spam')
_bytes_fname = os.fsencode(_fname)
fnames = [_fname, os_helper.FakePath(_fname),
_bytes_fname, os_helper.FakePath(_bytes_fname)]