]> granicus.if.org Git - python/commitdiff
Remove the old decimal context management tests from test_contextlib (guess who didn...
authorNick Coghlan <ncoghlan@gmail.com>
Thu, 31 Aug 2006 12:51:25 +0000 (12:51 +0000)
committerNick Coghlan <ncoghlan@gmail.com>
Thu, 31 Aug 2006 12:51:25 +0000 (12:51 +0000)
Lib/test/test_contextlib.py

index 2cf39ae6672fb2c595221392df38825d31e3a2c2..747785d54f75dfc6d46122645c7dfe851dad6ea3 100644 (file)
@@ -330,32 +330,6 @@ class LockContextTestCase(unittest.TestCase):
                 return True
         self.boilerPlate(lock, locked)
 
-class DecimalContextTestCase(unittest.TestCase):
-
-    # XXX Somebody should write more thorough tests for this
-
-    def testBasic(self):
-        ctx = decimal.getcontext()
-        orig_context = ctx.copy()
-        try:
-            ctx.prec = save_prec = decimal.ExtendedContext.prec + 5
-            with decimal.ExtendedContext.get_manager():
-                self.assertEqual(decimal.getcontext().prec,
-                                 decimal.ExtendedContext.prec)
-            self.assertEqual(decimal.getcontext().prec, save_prec)
-            try:
-                with decimal.ExtendedContext.get_manager():
-                    self.assertEqual(decimal.getcontext().prec,
-                                     decimal.ExtendedContext.prec)
-                    1/0
-            except ZeroDivisionError:
-                self.assertEqual(decimal.getcontext().prec, save_prec)
-            else:
-                self.fail("Didn't raise ZeroDivisionError")
-        finally:
-            decimal.setcontext(orig_context)
-
-
 # This is needed to make the test actually run under regrtest.py!
 def test_main():
     run_suite(