Skip to content

Commit 1261bfa

Browse files
authored
bpo-33901: Fix test_dbm_gnu for gdbm 1.15 (GH-7791)
Using gdbm 1.15, creating a database creates a file of 16 MiB. Adding a small entry and then modifying the small entry doesn't change the file size. Modify test_dbm_gnu to be less strict: allow that the file size doesn't change.
1 parent 22525de commit 1261bfa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Lib/test/test_dbm_gnu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ def test_reorganize(self):
7474

7575
self.g['x'] = 'x' * 10000
7676
size1 = os.path.getsize(filename)
77-
self.assertGreater(size1, size0)
77+
self.assertGreaterEqual(size1, size0)
7878

7979
del self.g['x']
8080
# 'size' is supposed to be the same even after deleting an entry.
8181
self.assertEqual(os.path.getsize(filename), size1)
8282

8383
self.g.reorganize()
8484
size2 = os.path.getsize(filename)
85-
self.assertLess(size2, size1)
85+
self.assertLessEqual(size2, size1)
8686
self.assertGreaterEqual(size2, size0)
8787

8888
def test_context_manager(self):
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fix test_dbm_gnu for gdbm 1.15. Using gdbm 1.15, creating a database creates
2+
a file of 16 MiB. Adding a small entry and then modifying the small entry
3+
doesn't change the file size. Modify test_dbm_gnu to be less strict: allow
4+
that the file size doesn't change.

0 commit comments

Comments
 (0)