[Python-checkins] python/dist/src/Lib/test test_decimal.py, 1.9,
1.10
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Wed Jul 14 18:35:32 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2022/test
Modified Files:
test_decimal.py
Log Message:
* Hide a loop induction variable that was inadvertantly being picked up
by the locals() call in the context constructor.
* Remove unnecessary properties for int, exp, and sign which duplicated
information returned by as_tuple().
Index: test_decimal.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_decimal.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_decimal.py 14 Jul 2004 15:41:57 -0000 1.9
--- test_decimal.py 14 Jul 2004 16:35:30 -0000 1.10
***************
*** 955,986 ****
self.assertEqual(d.as_tuple(), (0, (0,), 'F') )
- def test_immutability_onpurpose(self):
- #Try to change internal objects and see if immutable.
-
- d = Decimal(42)
-
- #you can get the attributes...
- d.exp
- d.int
- d.sign
-
- #...but not change them!
- try:
- d.exp = 20
- d.int = 3
- d.sign = 1
- except AttributeError:
- pass
- else:
- self.fail('Did not raised an error!')
-
- #some new attribute
- try:
- d.newone = None
- except AttributeError:
- pass
- else:
- self.fail('Did not raised an error!')
-
def test_immutability_operations(self):
# Do operations and check that it didn't change change internal objects.
--- 955,958 ----
More information about the Python-checkins
mailing list