diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-04-06 19:52:34 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-04-06 19:52:34 (GMT) |
commit | 278d03bd66e40d57168ff66c6fb79eae599a784d (patch) | |
tree | f1d79e038b315e6596d3dce29e75ff602446f2b6 /Lib | |
parent | 9e64c91c922564a0510ec667dd38c11a7c1bd748 (diff) | |
download | cpython-278d03bd66e40d57168ff66c6fb79eae599a784d.zip cpython-278d03bd66e40d57168ff66c6fb79eae599a784d.tar.gz cpython-278d03bd66e40d57168ff66c6fb79eae599a784d.tar.bz2 |
Revert a premature patch for issue #14010 (changeset aaaf36026511).
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_builtin.py | 34 | ||||
-rw-r--r-- | Lib/test/test_itertools.py | 117 |
2 files changed, 2 insertions, 149 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index b473b00..c342a43 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1565,40 +1565,8 @@ class TestSorted(unittest.TestCase): data = 'The quick Brown fox Jumped over The lazy Dog'.split() self.assertRaises(TypeError, sorted, data, None, lambda x,y: 0) -class TestRecursionLimit(unittest.TestCase): - # Issue #14010 - recursionlimit = sys.getrecursionlimit() - - def test_filter(self): - it = (0, 1) - for _ in range(self.recursionlimit): - it = filter(bool, it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_map(self): - it = (0, 1) - for _ in range(self.recursionlimit): - it = map(int, it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_zip(self): - it = (0, 1) - for _ in range(self.recursionlimit): - it = zip(it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_main(verbose=None): - test_classes = (BuiltinTest, TestSorted, TestRecursionLimit) + test_classes = (BuiltinTest, TestSorted) run_unittest(*test_classes) diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 5d5d8a6..53926a9 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -1809,121 +1809,6 @@ class SubclassWithKwargsTest(unittest.TestCase): self.assertNotIn("does not take keyword arguments", err.args[0]) -class TestRecursionLimit(unittest.TestCase): - # Issue #14010 - recursionlimit = sys.getrecursionlimit() - - def test_accumulate(self): - it = (0, 1) - for _ in range(self.recursionlimit): - it = accumulate(it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_chain(self): - it = (0, 1) - for _ in range(self.recursionlimit): - it = chain(it, ()) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_compress(self): - data = (0, 1) - selectors = (True, True) - it = data - for _ in range(self.recursionlimit): - it = compress(it, selectors) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - it = selectors - for _ in range(self.recursionlimit): - it = compress(data, it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_cycle(self): - it = (0, 1) - for _ in range(self.recursionlimit): - it = cycle(it) - with self.assertRaises(RuntimeError): - for _ in range(3): - next(it) - del it - - def test_dropwhile(self): - it = (0, 1, 0) - for _ in range(self.recursionlimit): - it = dropwhile(bool, it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_filterfalse(self): - it = (0, 1) - for _ in range(self.recursionlimit): - it = filterfalse(bool, it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_groupby(self): - key = operator.itemgetter(0) - it = ((0, []), (1, [])) - for _ in range(self.recursionlimit): - it = groupby(it, key) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_islice(self): - it = (0, 1) - for _ in range(self.recursionlimit): - it = islice(it, 2) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_starmap(self): - it = 'ab' - for _ in range(self.recursionlimit): - it = starmap(tuple, it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_takewhile(self): - it = (1, 0) - for _ in range(self.recursionlimit): - it = takewhile(bool, it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - def test_zip_longest(self): - it = (0, 1) - for _ in range(self.recursionlimit): - it = zip_longest(it) - with self.assertRaises(RuntimeError): - for _ in it: - pass - del it - - libreftest = """ Doctest for examples in the library reference: libitertools.tex @@ -2158,7 +2043,7 @@ __test__ = {'libreftest' : libreftest} def test_main(verbose=None): test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC, RegressionTests, LengthTransparency, - SubclassWithKwargsTest, TestExamples, TestRecursionLimit) + SubclassWithKwargsTest, TestExamples) support.run_unittest(*test_classes) # verify reference counting |