diff options
Diffstat (limited to 'Lib/test/test_fractions.py')
-rw-r--r-- | Lib/test/test_fractions.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py index 3336532..2dd528f 100644 --- a/Lib/test/test_fractions.py +++ b/Lib/test/test_fractions.py @@ -1,7 +1,7 @@ """Tests for Lib/fractions.py.""" from decimal import Decimal -from test.support import run_unittest, requires_IEEE_754 +from test.support import requires_IEEE_754 import math import numbers import operator @@ -330,7 +330,6 @@ class FractionTest(unittest.TestCase): self.assertTypedEquals(F(-2, 10), round(F(-15, 100), 1)) self.assertTypedEquals(F(-2, 10), round(F(-25, 100), 1)) - def testArithmetic(self): self.assertEqual(F(1, 2), F(1, 10) + F(2, 5)) self.assertEqual(F(-3, 10), F(1, 10) - F(2, 5)) @@ -402,6 +401,8 @@ class FractionTest(unittest.TestCase): self.assertTypedEquals(2.0 , 4 ** F(1, 2)) self.assertTypedEquals(0.25, 2.0 ** F(-2, 1)) self.assertTypedEquals(1.0 + 0j, (1.0 + 0j) ** F(1, 10)) + self.assertRaises(ZeroDivisionError, operator.pow, + F(0, 1), -2) def testMixingWithDecimal(self): # Decimal refuses mixed arithmetic (but not mixed comparisons) @@ -605,8 +606,5 @@ class FractionTest(unittest.TestCase): r = F(13, 7) self.assertRaises(AttributeError, setattr, r, 'a', 10) -def test_main(): - run_unittest(FractionTest, GcdTest) - if __name__ == '__main__': - test_main() + unittest.main() |