[Python-checkins] CVS: python/dist/src/Lib/test test_math.py,1.3,1.4

Fred L. Drake python-dev@python.org
Thu, 1 Jun 2000 10:59:19 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv28145

Modified Files:
	test_math.py 
Log Message:

Trent Mick <trentm@activestate.com>:
Fix test of the "math" module so it does not break on platforms that do
not offer rint(); just skip that portion of the test in that case.


Index: test_math.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_math.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** test_math.py	2000/05/11 18:19:41	1.3
--- test_math.py	2000/06/01 17:59:17	1.4
***************
*** 131,138 ****
  
  print 'rint'
! testit('rint(0.7)', math.rint(0.7), 1)
! testit('rint(-0.3)', math.rint(-0.3), 0)
! testit('rint(2.5)', math.rint(2.5), 2)
! testit('rint(3.5)', math.rint(3.5), 4) 
  
  print 'sin'
--- 131,144 ----
  
  print 'rint'
! try:
! 	math.rint
! except AttributeError:
! 	# this platform does not have rint, that is fine, skip the test
! 	pass
! else:
! 	testit('rint(0.7)', math.rint(0.7), 1)
! 	testit('rint(-0.3)', math.rint(-0.3), 0)
! 	testit('rint(2.5)', math.rint(2.5), 2)
! 	testit('rint(3.5)', math.rint(3.5), 4) 
  
  print 'sin'