https://github.com/python/cpython/commit/e7ab898188c6f41ee035bf264e06444d143a008c
commit: e7ab898188c6f41ee035bf264e06444d143a008c
branch: main
author: Bénédikt Tran <[email protected]>
committer: picnixz <[email protected]>
date: 2026-10-28T09:20:11+01:00
summary:

gh-140036: Test modulo and divmod of pure Python Decimal in unbounded contexts 
(#160482)

files:
M Lib/test/test_decimal.py

diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 6d68ba456fcdf8..424d3f577e9f87 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -4769,6 +4769,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()

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to