summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mailbox.py
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2012-06-15 18:01:39 (GMT)
committerPetri Lehtinen <petri@digip.org>2012-06-15 18:01:56 (GMT)
commita717d563d0807b4c95231fcebfd3fd7b5d567c26 (patch)
tree8f0c255e57d09ccb60ef2ae0c77306882069e718 /Lib/test/test_mailbox.py
parent3730a17a58d9058b0880202050a8c1e4ea193e8f (diff)
parent02653f1b111c8b9f64de8960d9a55d4f5821e257 (diff)
downloadcpython-a717d563d0807b4c95231fcebfd3fd7b5d567c26.zip
cpython-a717d563d0807b4c95231fcebfd3fd7b5d567c26.tar.gz
cpython-a717d563d0807b4c95231fcebfd3fd7b5d567c26.tar.bz2
#15036: Make a repeated changes and flushes work with single-file mailboxes
Diffstat (limited to 'Lib/test/test_mailbox.py')
-rw-r--r--Lib/test/test_mailbox.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 0fe4bd9..cb54505 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -504,6 +504,17 @@ class TestMailbox(TestBase):
# Write changes to disk
self._test_flush_or_close(self._box.flush, True)
+ def test_popitem_and_flush_twice(self):
+ # See #15036.
+ self._box.add(self._template % 0)
+ self._box.add(self._template % 1)
+ self._box.flush()
+
+ self._box.popitem()
+ self._box.flush()
+ self._box.popitem()
+ self._box.flush()
+
def test_lock_unlock(self):
# Lock and unlock the mailbox
self.assertFalse(os.path.exists(self._get_lock_path()))