[Python-checkins] cpython (merge 3.3 -> default): #17334: merge with 3.3.
ezio.melotti
python-checkins at python.org
Sat Mar 2 13:48:22 CET 2013
http://hg.python.org/cpython/rev/1c71882938eb
changeset: 82457:1c71882938eb
parent: 82455:b8bafae4a15a
parent: 82456:886df716cd09
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Sat Mar 02 14:48:01 2013 +0200
summary:
#17334: merge with 3.3.
files:
Lib/test/test_index.py | 29 ++++++++---------------------
Misc/NEWS | 3 +++
2 files changed, 11 insertions(+), 21 deletions(-)
diff --git a/Lib/test/test_index.py b/Lib/test/test_index.py
--- a/Lib/test/test_index.py
+++ b/Lib/test/test_index.py
@@ -56,7 +56,7 @@
self.assertRaises(TypeError, slice(self.n).indices, 0)
-class SeqTestCase(unittest.TestCase):
+class SeqTestCase:
# This test case isn't run directly. It just defines common tests
# to the different sequence types below
def setUp(self):
@@ -126,7 +126,7 @@
self.assertRaises(TypeError, sliceobj, self.n, self)
-class ListTestCase(SeqTestCase):
+class ListTestCase(SeqTestCase, unittest.TestCase):
seq = [0,10,20,30,40,50]
def test_setdelitem(self):
@@ -182,19 +182,19 @@
return self._list[index]
-class TupleTestCase(SeqTestCase):
+class TupleTestCase(SeqTestCase, unittest.TestCase):
seq = (0,10,20,30,40,50)
-class ByteArrayTestCase(SeqTestCase):
+class ByteArrayTestCase(SeqTestCase, unittest.TestCase):
seq = bytearray(b"this is a test")
-class BytesTestCase(SeqTestCase):
+class BytesTestCase(SeqTestCase, unittest.TestCase):
seq = b"this is a test"
-class StringTestCase(SeqTestCase):
+class StringTestCase(SeqTestCase, unittest.TestCase):
seq = "this is a test"
-class NewSeqTestCase(SeqTestCase):
+class NewSeqTestCase(SeqTestCase, unittest.TestCase):
seq = NewSeq((0,10,20,30,40,50))
@@ -237,18 +237,5 @@
self.assertRaises(OverflowError, lambda: "a" * self.neg)
-def test_main():
- support.run_unittest(
- BaseTestCase,
- ListTestCase,
- TupleTestCase,
- BytesTestCase,
- ByteArrayTestCase,
- StringTestCase,
- NewSeqTestCase,
- RangeTestCase,
- OverflowTestCase,
- )
-
if __name__ == "__main__":
- test_main()
+ unittest.main()
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -899,6 +899,9 @@
- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host.
+- Issue #17334: test_index now works with unittest test discovery.
+ Patch by Zachary Ware.
+
- Issue #17333: test_imaplib now works with unittest test discovery.
Patch by Zachary Ware.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list