annotate Lib/test/test_pow.py @ 54294:dba767bc3155 legacy-trunk

remove mention of old ctypes version
author Benjamin Peterson <benjamin@python.org>
date Sat, 23 May 2009 20:59:09 +0000
parents 64903ff76ede
children 614c84670c63
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27650
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
1 import test.test_support, unittest
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
2
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
3 class PowTest(unittest.TestCase):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
4
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
5 def powtest(self, type):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
6 if type != float:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
7 for i in range(-1000, 1000):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
8 self.assertEquals(pow(type(i), 0), 1)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
9 self.assertEquals(pow(type(i), 1), type(i))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
10 self.assertEquals(pow(type(0), 1), type(0))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
11 self.assertEquals(pow(type(1), 1), type(1))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
12
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
13 for i in range(-100, 100):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
14 self.assertEquals(pow(type(i), 3), i*i*i)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
15
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
16 pow2 = 1
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
17 for i in range(0,31):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
18 self.assertEquals(pow(2, i), pow2)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
19 if i != 30 : pow2 = pow2*2
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
20
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
21 for othertype in int, long:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
22 for i in range(-10, 0) + range(1, 10):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
23 ii = type(i)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
24 for j in range(1, 11):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
25 jj = -othertype(j)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
26 pow(ii, jj)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
27
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
28 for othertype in int, long, float:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
29 for i in range(1, 100):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
30 zero = type(0)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
31 exp = -othertype(i/10.0)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
32 if exp == 0:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
33 continue
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
34 self.assertRaises(ZeroDivisionError, pow, zero, exp)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
35
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
36 il, ih = -20, 20
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
37 jl, jh = -5, 5
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
38 kl, kh = -10, 10
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
39 asseq = self.assertEqual
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
40 if type == float:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
41 il = 1
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
42 asseq = self.assertAlmostEqual
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
43 elif type == int:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
44 jl = 0
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
45 elif type == long:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
46 jl, jh = 0, 15
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
47 for i in range(il, ih+1):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
48 for j in range(jl, jh+1):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
49 for k in range(kl, kh+1):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
50 if k != 0:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
51 if type == float or j < 0:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
52 self.assertRaises(TypeError, pow, type(i), j, k)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
53 continue
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
54 asseq(
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
55 pow(type(i),j,k),
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
56 pow(type(i),j)% type(k)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
57 )
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
58
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
59 def test_powint(self):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
60 self.powtest(int)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
61
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
62 def test_powlong(self):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
63 self.powtest(long)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
64
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
65 def test_powfloat(self):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
66 self.powtest(float)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
67
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
68 def test_other(self):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
69 # Other tests-- not very systematic
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
70 self.assertEquals(pow(3,3) % 8, pow(3,3,8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
71 self.assertEquals(pow(3,3) % -8, pow(3,3,-8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
72 self.assertEquals(pow(3,2) % -2, pow(3,2,-2))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
73 self.assertEquals(pow(-3,3) % 8, pow(-3,3,8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
74 self.assertEquals(pow(-3,3) % -8, pow(-3,3,-8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
75 self.assertEquals(pow(5,2) % -8, pow(5,2,-8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
76
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
77 self.assertEquals(pow(3L,3L) % 8, pow(3L,3L,8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
78 self.assertEquals(pow(3L,3L) % -8, pow(3L,3L,-8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
79 self.assertEquals(pow(3L,2) % -2, pow(3L,2,-2))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
80 self.assertEquals(pow(-3L,3L) % 8, pow(-3L,3L,8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
81 self.assertEquals(pow(-3L,3L) % -8, pow(-3L,3L,-8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
82 self.assertEquals(pow(5L,2) % -8, pow(5L,2,-8))
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
83
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
84 for i in range(-10, 11):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
85 for j in range(0, 6):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
86 for k in range(-7, 11):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
87 if j >= 0 and k != 0:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
88 self.assertEquals(
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
89 pow(i,j) % k,
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
90 pow(i,j,k)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
91 )
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
92 if j >= 0 and k != 0:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
93 self.assertEquals(
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
94 pow(long(i),j) % k,
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
95 pow(long(i),j,k)
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
96 )
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
97
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
98 def test_bug643260(self):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
99 class TestRpow:
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
100 def __rpow__(self, other):
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
101 return None
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
102 None ** TestRpow() # Won't fail when __rpow__ invoked. SF bug #643260.
1777
7e001c4810bb Test set for new pow() function
Guido van Rossum <guido@python.org>
parents:
diff changeset
103
29252
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
104 def test_bug705231(self):
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
105 # -1.0 raised to an integer should never blow up. It did if the
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
106 # platform pow() was buggy, and Python didn't worm around it.
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
107 eq = self.assertEquals
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
108 a = -1.0
42370
64903ff76ede Add explicit test for a misbehaving math.floor
Nick Coghlan <ncoghlan@gmail.com>
parents: 42362
diff changeset
109 # The next two tests can still fail if the platform floor()
64903ff76ede Add explicit test for a misbehaving math.floor
Nick Coghlan <ncoghlan@gmail.com>
parents: 42362
diff changeset
110 # function doesn't treat all large inputs as integers
64903ff76ede Add explicit test for a misbehaving math.floor
Nick Coghlan <ncoghlan@gmail.com>
parents: 42362
diff changeset
111 # test_math should also fail if that is happening
29252
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
112 eq(pow(a, 1.23e167), 1.0)
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
113 eq(pow(a, -1.23e167), 1.0)
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
114 for b in range(-10, 11):
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
115 eq(pow(a, float(b)), b & 1 and -1.0 or 1.0)
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
116 for n in range(0, 100):
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
117 fiveto = float(5 ** n)
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
118 # For small n, fiveto will be odd. Eventually we run out of
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
119 # mantissa bits, though, and thereafer fiveto will be even.
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
120 expected = fiveto % 2.0 and -1.0 or 1.0
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
121 eq(pow(a, fiveto), expected)
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
122 eq(pow(a, -fiveto), expected)
0b76679bf3f9 SF bug 705231: Assertion failed, python aborts.
Tim Peters <tim.peters@gmail.com>
parents: 28917
diff changeset
123 eq(expected, 1.0) # else we didn't push fiveto to evenness
19614
f4a899e7ec93 Added a regression test for the negation-of-exponentiation optimization
Fred Drake <fdrake@acm.org>
parents: 18507
diff changeset
124
27650
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
125 def test_main():
28917
1741af48fd9f Combine the functionality of test_support.run_unittest()
Walter Dörwald <walter@livinglogic.de>
parents: 27650
diff changeset
126 test.test_support.run_unittest(PowTest)
1777
7e001c4810bb Test set for new pow() function
Guido van Rossum <guido@python.org>
parents:
diff changeset
127
27650
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
128 if __name__ == "__main__":
f260343eccf1 Port test_pow.py to PyUnit. From SF patch #662807
Walter Dörwald <walter@livinglogic.de>
parents: 26567
diff changeset
129 test_main()