diff Lib/test/test_long.py @ 81102:eb1734e579f7 2.7

Issue #16790: add some of the recent issue #16045 int tests to test_long. This patch also provides a simple way to share tests going forward between test_int and test_long.
author Chris Jerdonek <chris.jerdonek@gmail.com>
date Thu, 27 Dec 2012 12:53:29 -0800
parents b36cb4602e21
children
line wrap: on
line diff
--- a/Lib/test/test_long.py	Thu Dec 27 14:37:06 2012 -0600
+++ b/Lib/test/test_long.py	Thu Dec 27 12:53:29 2012 -0800
@@ -1,10 +1,11 @@
 import unittest
-from test import test_support
 import sys
 
 import random
 import math
 
+from test import test_int, test_support
+
 # Used for lazy formatting of failure messages
 class Frm(object):
     def __init__(self, format, *args):
@@ -78,8 +79,9 @@
         (unichr(0x200), ValueError),
 ]
 
+class LongTest(test_int.IntLongCommonTests, unittest.TestCase):
 
-class LongTest(unittest.TestCase):
+    ntype = long
 
     # Get quasi-random long consisting of ndigits digits (in base BASE).
     # quasi == the most-significant digit will not be 0, and the number