summaryrefslogtreecommitdiff
path: root/Lib/test/test_decimal.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2006-09-02 03:54:17 +0000
committerNick Coghlan <ncoghlan@gmail.com>2006-09-02 03:54:17 +0000
commitced1218dd1b69ac848f8c79d1afaada5669af33c (patch)
tree597ddd3968f4db0a4b7fb6a6b6c238eb9e49319b /Lib/test/test_decimal.py
parent69e88975059b0c74e3e9a17dd46b715a532cfd20 (diff)
downloadcpython-git-ced1218dd1b69ac848f8c79d1afaada5669af33c.tar.gz
Make decimal.ContextManager a private implementation detail of decimal.localcontext()
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r--Lib/test/test_decimal.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 6e7faf5fcc..841ea6fc06 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -1068,20 +1068,9 @@ class ContextAPItests(unittest.TestCase):
class WithStatementTest(unittest.TestCase):
# Can't do these as docstrings until Python 2.6
# as doctest can't handle __future__ statements
- def test_ContextManager(self):
- # The basic context manager uses the supplied context
- # without making a copy of it
- orig_ctx = getcontext()
- new_ctx = Context()
- with ContextManager(new_ctx) as enter_ctx:
- set_ctx = getcontext()
- final_ctx = getcontext()
- self.assert_(orig_ctx is final_ctx, 'did not restore context correctly')
- self.assert_(new_ctx is set_ctx, 'did not set correct context')
- self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context')
def test_localcontext(self):
- # The helper function makes a copy of the supplied context
+ # Use a copy of the current context in the block
orig_ctx = getcontext()
with localcontext() as enter_ctx:
set_ctx = getcontext()
@@ -1091,7 +1080,7 @@ class WithStatementTest(unittest.TestCase):
self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context')
def test_localcontextarg(self):
- # The helper function makes a copy of the supplied context
+ # Use a copy of the supplied context in the block
orig_ctx = getcontext()
new_ctx = Context(prec=42)
with localcontext(new_ctx) as enter_ctx: