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.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 1972ca3..84a9e5c 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -208,7 +208,7 @@ class TestMailbox(TestBase):
for value in method():
self.fail("Not empty")
keys, values = [], []
- for i in xrange(repetitions):
+ for i in range(repetitions):
keys.append(self._box.add(self._template % i))
values.append(self._template % i)
if do_keys and not do_values:
@@ -254,11 +254,11 @@ class TestMailbox(TestBase):
def test_len(self, repetitions=10):
# Get message count
keys = []
- for i in xrange(repetitions):
+ for i in range(repetitions):
self.assert_(len(self._box) == i)
keys.append(self._box.add(self._template % i))
self.assert_(len(self._box) == i + 1)
- for i in xrange(repetitions):
+ for i in range(repetitions):
self.assert_(len(self._box) == repetitions - i)
self._box.remove(keys[i])
self.assert_(len(self._box) == repetitions - i - 1)
@@ -293,7 +293,7 @@ class TestMailbox(TestBase):
def test_clear(self, iterations=10):
# Remove all messages using clear()
keys = []
- for i in xrange(iterations):
+ for i in range(iterations):
self._box.add(self._template % i)
for i, key in enumerate(keys):
self.assert_(self._box.get_string(key) == self._template % i)
@@ -323,10 +323,10 @@ class TestMailbox(TestBase):
def test_popitem(self, iterations=10):
# Get and remove an arbitrary (key, message) using popitem()
keys = []
- for i in xrange(10):
+ for i in range(10):
keys.append(self._box.add(self._template % i))
seen = []
- for i in xrange(10):
+ for i in range(10):
key, msg = self._box.popitem()
self.assert_(key in keys)
self.assert_(key not in seen)
@@ -387,7 +387,7 @@ class TestMailbox(TestBase):
self._test_flush_or_close(self._box.close)
def _test_flush_or_close(self, method):
- contents = [self._template % i for i in xrange(3)]
+ contents = [self._template % i for i in range(3)]
self._box.add(contents[0])
self._box.add(contents[1])
self._box.add(contents[2])
@@ -599,7 +599,7 @@ class TestMaildir(TestMailbox):
pattern = re.compile(r"(?P<time>\d+)\.M(?P<M>\d{1,6})P(?P<P>\d+)"
r"Q(?P<Q>\d+)\.(?P<host>[^:/]+)")
previous_groups = None
- for x in xrange(repetitions):
+ for x in range(repetitions):
tmp_file = self._box._create_tmp()
head, tail = os.path.split(tmp_file.name)
self.assertEqual(head, os.path.abspath(os.path.join(self._path,
@@ -703,7 +703,7 @@ class _TestMboxMMDF(TestMailbox):
def test_open_close_open(self):
# Open and inspect previously-created mailbox
- values = [self._template % i for i in xrange(3)]
+ values = [self._template % i for i in range(3)]
for value in values:
self._box.add(value)
self._box.close()
@@ -718,7 +718,7 @@ class _TestMboxMMDF(TestMailbox):
def test_add_and_close(self):
# Verifying that closing a mailbox doesn't change added items
self._box.add(_sample_message)
- for i in xrange(3):
+ for i in range(3):
self._box.add(self._template % i)
self._box.add(_sample_message)
self._box._file.flush()