summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mailbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_mailbox.py')
-rw-r--r--Lib/test/test_mailbox.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 925f878..8f4b486 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -374,7 +374,7 @@ class TestMailbox(TestBase):
def test_flush(self):
# Write changes to disk
- self._test_flush_or_close(self._box.flush)
+ self._test_flush_or_close(self._box.flush, True)
def test_lock_unlock(self):
# Lock and unlock the mailbox
@@ -386,15 +386,17 @@ class TestMailbox(TestBase):
def test_close(self):
# Close mailbox and flush changes to disk
- self._test_flush_or_close(self._box.close)
+ self._test_flush_or_close(self._box.close, False)
- def _test_flush_or_close(self, method):
+ def _test_flush_or_close(self, method, should_call_close):
contents = [self._template % i for i in range(3)]
self._box.add(contents[0])
self._box.add(contents[1])
self._box.add(contents[2])
oldbox = self._box
method()
+ if should_call_close:
+ self._box.close()
self._box = self._factory(self._path)
keys = self._box.keys()
self.assertEqual(len(keys), 3)