Author: Ronan Lamy <[email protected]>
Branch:
Changeset: r92314:3e52029e9a5a
Date: 2017-09-04 01:42 +0100
http://bitbucket.org/pypy/pypy/changeset/3e52029e9a5a/
Log: cleanup
diff --git a/pypy/module/itertools/test/test_itertools.py
b/pypy/module/itertools/test/test_itertools.py
--- a/pypy/module/itertools/test/test_itertools.py
+++ b/pypy/module/itertools/test/test_itertools.py
@@ -1,7 +1,7 @@
import py
-class AppTestItertools:
+class AppTestItertools(object):
spaceconfig = dict(usemodules=['itertools'])
def test_count(self):
@@ -330,11 +330,11 @@
def test_chain(self):
import itertools
-
+
it = itertools.chain()
raises(StopIteration, it.next)
raises(StopIteration, it.next)
-
+
it = itertools.chain([1, 2, 3])
for x in [1, 2, 3]:
assert it.next() == x
@@ -378,7 +378,7 @@
def test_imap_wrongargs(self):
import itertools
-
+
# Duplicate python 2.4 behaviour for invalid arguments
it = itertools.imap(0, [])
raises(StopIteration, it.next)
@@ -401,11 +401,11 @@
for x in obj_list:
assert it.next() == (x, )
raises(StopIteration, it.next)
-
+
it = itertools.izip([1, 2, 3], [4], [5, 6])
assert it.next() == (1, 4, 5)
raises(StopIteration, it.next)
-
+
it = itertools.izip([], [], [1], [])
raises(StopIteration, it.next)
@@ -423,7 +423,7 @@
def test_izip_wrongargs(self):
import itertools, re
-
+
# Duplicate python 2.4 behaviour for invalid arguments
raises(TypeError, itertools.izip, None, 0)
@@ -442,7 +442,7 @@
it = itertools.cycle([])
raises(StopIteration, it.next)
-
+
it = itertools.cycle([1, 2, 3])
for x in [1, 2, 3, 1, 2, 3, 1, 2, 3]:
assert it.next() == x
@@ -498,7 +498,7 @@
def test_tee_wrongargs(self):
import itertools
-
+
raises(TypeError, itertools.tee, 0)
raises(ValueError, itertools.tee, [], -1)
raises(TypeError, itertools.tee, [], None)
@@ -536,7 +536,7 @@
def test_groupby(self):
import itertools
-
+
it = itertools.groupby([])
raises(StopIteration, it.next)
@@ -613,7 +613,7 @@
assert g.next() is x
raises(StopIteration, g.next)
raises(StopIteration, it.next)
-
+
# Grouping is based on key equality
class AlwaysEqual(object):
def __eq__(self, other):
@@ -647,7 +647,7 @@
def test_iterables(self):
import itertools
-
+
iterables = [
itertools.chain(),
itertools.count(),
@@ -665,7 +665,7 @@
itertools.tee([])[0],
itertools.tee([])[1],
]
-
+
for it in iterables:
assert hasattr(it, '__iter__')
assert iter(it) is it
@@ -674,7 +674,7 @@
def test_docstrings(self):
import itertools
-
+
assert itertools.__doc__
methods = [
itertools.chain,
@@ -756,15 +756,9 @@
assert itertools.tee(a, 0) == ()
-class AppTestItertools26:
+class AppTestItertools26(object):
spaceconfig = dict(usemodules=['itertools'])
- def setup_class(cls):
- if cls.space.is_true(cls.space.appexec([], """():
- import sys; return sys.version_info < (2, 6)
- """)):
- py.test.skip("Requires Python 2.6")
-
def test_count_overflow(self):
import itertools, sys
it = itertools.count(sys.maxint - 1)
@@ -1010,16 +1004,8 @@
raises(ValueError, permutations, [1, 2], -1)
-class AppTestItertools27:
- spaceconfig = {
- "usemodules": ['itertools', 'struct', 'binascii'],
- }
-
- def setup_class(cls):
- if cls.space.is_true(cls.space.appexec([], """():
- import sys; return sys.version_info < (2, 7)
- """)):
- py.test.skip("Requires Python 2.7")
+class AppTestItertools27(object):
+ spaceconfig = {"usemodules": ['itertools', 'struct', 'binascii']}
def test_compress(self):
import itertools
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit