mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
* Rename "Signals" to "_signals" making it non-public.
* Context.create_decimal can take a zero default just like Decimal(). * Fix typo in comment.
This commit is contained in:
parent
b60b242d29
commit
fed52963fc
2 changed files with 13 additions and 8 deletions
|
@ -35,6 +35,9 @@ from test.test_support import TestSkipped, run_unittest, run_doctest, is_resourc
|
|||
import threading
|
||||
import random
|
||||
|
||||
# Useful Test Constant
|
||||
Signals = getcontext().flags.keys()
|
||||
|
||||
# Tests are built around these assumed context defaults
|
||||
DefaultContext.prec=9
|
||||
DefaultContext.rounding=ROUND_HALF_EVEN
|
||||
|
@ -480,7 +483,10 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
|
|||
nc.prec = 3
|
||||
|
||||
# empty
|
||||
self.assertRaises(TypeError, nc.create_decimal)
|
||||
d = Decimal()
|
||||
self.assertEqual(str(d), '0')
|
||||
d = nc.create_decimal()
|
||||
self.assertEqual(str(d), '0')
|
||||
|
||||
# from None
|
||||
self.assertRaises(TypeError, nc.create_decimal, None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue