diff options
| author | Nick Coghlan <ncoghlan@gmail.com> | 2006-09-03 01:08:30 (GMT) |
|---|---|---|
| committer | Nick Coghlan <ncoghlan@gmail.com> | 2006-09-03 01:08:30 (GMT) |
| commit | c48daf5bc47383fa8f49fac91babf1d850e6df46 (patch) | |
| tree | 1b0c8bfe0b3b3d5ed751518a41dff5cdac9e7f7b /Lib/test/test_contextlib.py | |
| parent | f07b590d7e459062f78f9735f7330c0046b61c14 (diff) | |
| download | cpython-c48daf5bc47383fa8f49fac91babf1d850e6df46.zip cpython-c48daf5bc47383fa8f49fac91babf1d850e6df46.tar.gz cpython-c48daf5bc47383fa8f49fac91babf1d850e6df46.tar.bz2 | |
Backport of decimal module context management updates from rev 51694 to 2.5 release branch
Diffstat (limited to 'Lib/test/test_contextlib.py')
| -rw-r--r-- | Lib/test/test_contextlib.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py index 2cf39ae..747785d 100644 --- a/Lib/test/test_contextlib.py +++ b/Lib/test/test_contextlib.py @@ -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( |
