mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.14] gh-124486: Fix test_whichdb_ndbm in test_dbm on NetBSD (GH-136335) (GH-136378)
On NetBSD, ndbm.open() does not fail for empty file.
(cherry picked from commit b7aa2a4b4d
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
a7dd48acba
commit
d9c36a7aa6
1 changed files with 2 additions and 1 deletions
|
@ -213,7 +213,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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue