[pypy-svn] pypy collections-module: len().

arigo commits-noreply at bitbucket.org
Tue Feb 15 17:26:08 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: collections-module
Changeset: r41977:a85cb55fcf53
Date: 2011-02-15 17:21 +0100
http://bitbucket.org/pypy/pypy/changeset/a85cb55fcf53/

Log:	len().

diff --git a/pypy/module/_collections/test/test_deque.py b/pypy/module/_collections/test/test_deque.py
--- a/pypy/module/_collections/test/test_deque.py
+++ b/pypy/module/_collections/test/test_deque.py
@@ -192,20 +192,21 @@
         assert tuple(d) == tuple(s)
 
     def test_len(self):
+        from _collections import deque
         d = deque('ab')
-        self.assertEqual(len(d), 2)
+        assert len(d) == 2
         d.popleft()
-        self.assertEqual(len(d), 1)
+        assert len(d) == 1
         d.pop()
-        self.assertEqual(len(d), 0)
-        self.assertRaises(IndexError, d.pop)
-        self.assertEqual(len(d), 0)
+        assert len(d) == 0
+        raises(IndexError, d.pop)
+        assert len(d) == 0
         d.append('c')
-        self.assertEqual(len(d), 1)
+        assert len(d) == 1
         d.appendleft('d')
-        self.assertEqual(len(d), 2)
+        assert len(d) == 2
         d.clear()
-        self.assertEqual(len(d), 0)
+        assert len(d) == 0
 
     def test_underflow(self):
         d = deque()


More information about the Pypy-commit mailing list