[Python-checkins] python/dist/src/Lib/test test_operator.py,1.9,1.10
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Sun, 18 Aug 2002 20:19:11 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv23917/Lib/test
Modified Files:
test_operator.py
Log Message:
Added __pow__(a,b) to the operator module. Completes the pattern of
all operators having a counterpart in the operator module.
Closes SF bug #577513.
Index: test_operator.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_operator.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** test_operator.py 23 Jul 2002 19:03:58 -0000 1.9
--- test_operator.py 19 Aug 2002 03:19:09 -0000 1.10
***************
*** 162,165 ****
--- 162,171 ----
self.failUnless(operator.pos(-0) == 0)
+ def test_pow(self):
+ self.failUnless(operator.pow(3,5) == 3**5)
+ self.failUnless(operator.__pow__(3,5) == 3**5)
+ self.assertRaises(TypeError, operator.pow, 1)
+ self.assertRaises(TypeError, operator.pow, 1, 2, 3)
+
def test_repeat(self):
a = range(3)