@@ -521,7 +521,7 @@ def testFactorialNonIntegers(self):
521521 # Other implementations may place different upper bounds.
522522 @support .cpython_only
523523 def testFactorialHugeInputs (self ):
524- # Currently raises ValueError for inputs that are too large
524+ # Currently raises OverflowError for inputs that are too large
525525 # to fit into a C long.
526526 self .assertRaises (OverflowError , math .factorial , 10 ** 100 )
527527 self .assertRaises (OverflowError , math .factorial , 1e100 )
@@ -1917,7 +1917,8 @@ def testPerm(self):
19171917 self .assertEqual (perm (n , 0 ), 1 )
19181918 self .assertEqual (perm (n , 1 ), n )
19191919 self .assertEqual (perm (n , 2 ), n * (n - 1 ))
1920- self .assertRaises ((OverflowError , MemoryError ), perm , n , n )
1920+ if support .check_impl_detail (cpython = True ):
1921+ self .assertRaises (OverflowError , perm , n , n )
19211922
19221923 for n , k in (True , True ), (True , False ), (False , False ):
19231924 self .assertEqual (perm (n , k ), 1 )
@@ -1986,7 +1987,8 @@ def testComb(self):
19861987 self .assertEqual (comb (n , n ), 1 )
19871988 self .assertEqual (comb (n , n - 1 ), n )
19881989 self .assertEqual (comb (n , n - 2 ), n * (n - 1 ) // 2 )
1989- self .assertRaises ((OverflowError , MemoryError ), comb , n , n // 2 )
1990+ if support .check_impl_detail (cpython = True ):
1991+ self .assertRaises (OverflowError , comb , n , n // 2 )
19901992
19911993 for n , k in (True , True ), (True , False ), (False , False ):
19921994 self .assertEqual (comb (n , k ), 1 )
0 commit comments