Skip to content

Commit 7532c45

Browse files
serhiy-storchakataegyunkim
authored andcommitted
pythongh-124486: Fix test_whichdb_ndbm in test_dbm on NetBSD (pythonGH-136335)
On NetBSD, ndbm.open() does not fail for empty file.
1 parent 6a7e029 commit 7532c45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_dbm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ def test_whichdb(self):
274274
@unittest.skipUnless(ndbm, reason='Test requires ndbm')
275275
def test_whichdb_ndbm(self):
276276
# Issue 17198: check that ndbm which is referenced in whichdb is defined
277-
with open(_fname + '.db', 'wb'): pass
277+
with open(_fname + '.db', 'wb') as f:
278+
f.write(b'spam')
278279
_bytes_fname = os.fsencode(_fname)
279280
fnames = [_fname, os_helper.FakePath(_fname),
280281
_bytes_fname, os_helper.FakePath(_bytes_fname)]

0 commit comments

Comments
 (0)