From 9cd17953551f57cf2c36e61baf30e87e02120e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= <10796600+picnixz@users.noreply.github.com> Date: Wed, 28 Oct 2026 01:20:11 -0700 Subject: [PATCH] gh-140036: Test modulo and divmod of pure Python Decimal in unbounded contexts (GH-160482) (cherry picked from commit e7ab898188c6f41ee035bf264e06444d143a008c) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> --- Lib/test/test_decimal.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index bd02dfbabe6cbb..17029c5aedb908 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -4716,6 +4716,16 @@ def test_divide_unbound_context(self): x = self.decimal.Decimal('1') y = x // 1 # should be fast + def test_modulo_unbound_context(self): + with self.unbound_context() as c: + x = self.decimal.Decimal('1') + y = x % 1 # should be fast + + def test_divmod_unbound_context(self): + with self.unbound_context() as c: + x = self.decimal.Decimal('1') + y = divmod(x, 1) # should be fast + def test_remainder_near(self): L = 1000 limit = sys.get_int_max_str_digits()