From e08fda912fc6fe66f185524bd1ad0585bcadeef7 Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Thu, 2 May 2002 18:40:31 +0000 Subject: Remove all tests that rely on deprecated-in-2.2 features of xrange objects. "What's New in Python 2.2" documented that these would be removed in Python 2.3. --- Lib/test/test_b2.py | 21 --------------------- Lib/test/test_repr.py | 8 -------- 2 files changed, 29 deletions(-) diff --git a/Lib/test/test_b2.py b/Lib/test/test_b2.py index 9f020de..72810cb 100644 --- a/Lib/test/test_b2.py +++ b/Lib/test/test_b2.py @@ -295,27 +295,6 @@ if tuple(xrange(10)) != tuple(range(10)): raise TestFailed, 'xrange(10)' if tuple(xrange(5,10)) != tuple(range(5,10)): raise TestFailed, 'xrange(5,10)' if tuple(xrange(0,10,2)) != tuple(range(0,10,2)): raise TestFailed, 'xrange(0,10,2)' -r = xrange(10) -if r.tolist() != range(10): raise TestFailed, 'xrange(10).tolist()' -if r.start != 0: raise TestFailed, 'xrange(10).start' -if r.stop != 10: raise TestFailed, 'xrange(10).stop' -if r.step != 1: raise TestFailed, 'xrange(10).step' -r = xrange(3, 10) -if r.tolist() != range(3, 10): raise TestFailed, 'xrange(3, 10).tolist()' -if r.start != 3: raise TestFailed, 'xrange(3, 10).start' -if r.stop != 10: raise TestFailed, 'xrange(3, 10).stop' -if r.step != 1: raise TestFailed, 'xrange(3, 10).step' -r = xrange(3, 10, 2) -if r.tolist() != range(3, 10, 2): raise TestFailed, 'xrange(3, 10, 2).tolist()' -if r.start != 3: raise TestFailed, 'xrange(3, 10, 2).start' -if r.stop != 11: raise TestFailed, 'xrange(3, 10, 2).stop' -if r.step != 2: raise TestFailed, 'xrange(3, 10, 2).step' -r = xrange(10, 3, -1) -if r.tolist() != range(10, 3, -1): - raise TestFailed, 'xrange(10, 3, -1).tolist()' -if r.start != 10: raise TestFailed, 'xrange(10, 3, -1).start' -if r.stop != 3: raise TestFailed, 'xrange(10, 3, -1).stop' -if r.step != -1: raise TestFailed, 'xrange(10, 3, -1).step' print 'zip' a = (1, 2, 3) diff --git a/Lib/test/test_repr.py b/Lib/test/test_repr.py index 1d7ea85..f8aad94 100644 --- a/Lib/test/test_repr.py +++ b/Lib/test/test_repr.py @@ -110,14 +110,6 @@ class ReprTests(unittest.TestCase): eq(repr(xrange(1)), 'xrange(1)') eq(repr(xrange(1, 2)), 'xrange(1, 2)') eq(repr(xrange(1, 2, 3)), 'xrange(1, 4, 3)') - # Turn off warnings for deprecated multiplication - warnings.filterwarnings('ignore', - r'xrange object multiplication is deprecated', - DeprecationWarning, module=ReprTests.__module__) - warnings.filterwarnings('ignore', - r"PyRange_New's 'repetitions' argument is deprecated", - DeprecationWarning, module=ReprTests.__module__) - eq(repr(xrange(1) * 3), '(xrange(1) * 3)') def test_nesting(self): eq = self.assertEquals -- cgit v0.12