summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-06-19 12:19:54 (GMT)
committerGitHub <noreply@github.com>2018-06-19 12:19:54 (GMT)
commit1261bfa83db30b1cf86c1fb816cc167db77874cd (patch)
treed2310a4d1323494f74a1f7a990f7382bffeeb8ed
parent22525de737679ace1488e63b7ed289bdb253ffc7 (diff)
downloadcpython-1261bfa83db30b1cf86c1fb816cc167db77874cd.zip
cpython-1261bfa83db30b1cf86c1fb816cc167db77874cd.tar.gz
cpython-1261bfa83db30b1cf86c1fb816cc167db77874cd.tar.bz2
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.
-rw-r--r--Lib/test/test_dbm_gnu.py4
-rw-r--r--Misc/NEWS.d/next/Tests/2018-06-19-14-04-21.bpo-33901.OFW1Sr.rst4
2 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py
index 50b8a19..8d76fc7 100644
--- a/Lib/test/test_dbm_gnu.py
+++ b/Lib/test/test_dbm_gnu.py
@@ -74,7 +74,7 @@ class TestGdbm(unittest.TestCase):
self.g['x'] = 'x' * 10000
size1 = os.path.getsize(filename)
- self.assertGreater(size1, size0)
+ self.assertGreaterEqual(size1, size0)
del self.g['x']
# 'size' is supposed to be the same even after deleting an entry.
@@ -82,7 +82,7 @@ class TestGdbm(unittest.TestCase):
self.g.reorganize()
size2 = os.path.getsize(filename)
- self.assertLess(size2, size1)
+ self.assertLessEqual(size2, size1)
self.assertGreaterEqual(size2, size0)
def test_context_manager(self):
diff --git a/Misc/NEWS.d/next/Tests/2018-06-19-14-04-21.bpo-33901.OFW1Sr.rst b/Misc/NEWS.d/next/Tests/2018-06-19-14-04-21.bpo-33901.OFW1Sr.rst
new file mode 100644
index 0000000..0ca9b60
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2018-06-19-14-04-21.bpo-33901.OFW1Sr.rst
@@ -0,0 +1,4 @@
+Fix test_dbm_gnu for gdbm 1.15. 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.