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