(self)
| 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 |
| 3723 | Context = self.decimal.Context |
| 3724 | getcontext = self.decimal.getcontext |
| 3725 | localcontext = self.decimal.localcontext |
| 3726 | |
| 3727 | localcontext = self.decimal.localcontext |
| 3728 | orig_ctx = getcontext() |
| 3729 | new_ctx = Context(prec=42) |
| 3730 | with localcontext(new_ctx) as enter_ctx: |
| 3731 | set_ctx = getcontext() |
| 3732 | final_ctx = getcontext() |
| 3733 | self.assertIs(orig_ctx, final_ctx, 'did not restore context correctly') |
| 3734 | self.assertEqual(set_ctx.prec, new_ctx.prec, 'did not set correct context') |
| 3735 | self.assertIsNot(new_ctx, set_ctx, 'did not copy the context') |
| 3736 | self.assertIs(set_ctx, enter_ctx, '__enter__ returned wrong context') |
| 3737 | |
| 3738 | def test_localcontext_kwargs(self): |
| 3739 | with self.decimal.localcontext( |
nothing calls this directly
no test coverage detected