(self)
| 3711 | # as doctest can't handle __future__ statements |
| 3712 | |
| 3713 | def test_localcontext(self): |
| 3714 | # Use a copy of the current context in the block |
| 3715 | getcontext = self.decimal.getcontext |
| 3716 | localcontext = self.decimal.localcontext |
| 3717 | |
| 3718 | orig_ctx = getcontext() |
| 3719 | with localcontext() as enter_ctx: |
| 3720 | set_ctx = getcontext() |
| 3721 | final_ctx = getcontext() |
| 3722 | self.assertIs(orig_ctx, final_ctx, 'did not restore context correctly') |
| 3723 | self.assertIsNot(orig_ctx, set_ctx, 'did not copy the context') |
| 3724 | self.assertIs(set_ctx, enter_ctx, '__enter__ returned wrong context') |
| 3725 | |
| 3726 | def test_localcontextarg(self): |
| 3727 | # Use a copy of the supplied context in the block |
nothing calls this directly
no test coverage detected