diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-19 18:34:55 +0000 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-19 18:34:55 +0000 |
commit | bc27c6a5aa75a8f52304ecd311fbadef4ec621ce (patch) | |
tree | 5634ee9187192196c6e565e491144e2574c436ef /Lib/test/test_index.py | |
parent | 4854c969fb6f42b3d67e14977bc3f0f6f3ec70c9 (diff) | |
download | cpython-git-bc27c6a5aa75a8f52304ecd311fbadef4ec621ce.tar.gz |
Various tests cleanup: check_warnings/check_py3k_warnings, unittest.assert* and setUp/tearDown.
Diffstat (limited to 'Lib/test/test_index.py')
-rw-r--r-- | Lib/test/test_index.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_index.py b/Lib/test/test_index.py index 84d83fba22..abc80418a4 100644 --- a/Lib/test/test_index.py +++ b/Lib/test/test_index.py @@ -170,7 +170,7 @@ class ListTestCase(SeqTestCase): lst = [5, 6, 7, 8, 9, 11] l2 = lst.__imul__(self.n) - self.assertTrue(l2 is lst) + self.assertIs(l2, lst) self.assertEqual(lst, [5, 6, 7, 8, 9, 11] * 3) @@ -214,6 +214,9 @@ class TupleTestCase(SeqTestCase): class StringTestCase(SeqTestCase): seq = "this is a test" +class ByteArrayTestCase(SeqTestCase): + seq = bytearray("this is a test") + class UnicodeTestCase(SeqTestCase): seq = u"this is a test" @@ -265,7 +268,7 @@ class OverflowTestCase(unittest.TestCase): def _getslice_helper_deprecated(self, base): class GetItem(base): def __len__(self): - return maxint #cannot return long here + return maxint # cannot return long here def __getitem__(self, key): return key def __getslice__(self, i, j): @@ -299,6 +302,7 @@ def test_main(): BaseTestCase, ListTestCase, TupleTestCase, + ByteArrayTestCase, StringTestCase, UnicodeTestCase, ClassicSeqTestCase, |