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