[Python-checkins] python/dist/src/Lib/test test_descr.py,1.178,1.179

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
Sun, 09 Feb 2003 18:12:45 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv13524/Lib/test

Modified Files:
	test_descr.py 
Log Message:
Fix SF bug #683467, 'int' ability to generate longs not inherited

When subclassing from an int but not overriding __new__,
long values were not converted properly.  Try to convert
longs into an int.


Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.178
retrieving revision 1.179
diff -C2 -d -r1.178 -r1.179
*** test_descr.py	7 Feb 2003 14:59:13 -0000	1.178
--- test_descr.py	10 Feb 2003 02:12:43 -0000	1.179
***************
*** 459,462 ****
--- 459,463 ----
          def __add__(self, other):
              return NotImplemented
+     vereq(C(5L), 5)
      try:
          C() + ""
***************
*** 465,468 ****
--- 466,476 ----
      else:
          raise TestFailed, "NotImplemented should have caused TypeError"
+     import sys
+     try:
+         C(sys.maxint+1)
+     except OverflowError:
+         pass
+     else:
+         raise TestFailed, "should have raised OverflowError"
  
  def longs():