summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_decimal.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r--Lib/test/test_decimal.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 59a17af..48360d1 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -1185,6 +1185,16 @@ class FormatTest(unittest.TestCase):
self.assertEqual(format(Decimal('100000000.123'), 'n'),
'100\u066c000\u066c000\u066b123')
+ def test_decimal_from_float_argument_type(self):
+ class A(self.decimal.Decimal):
+ def __init__(self, a):
+ self.a_type = type(a)
+ a = A.from_float(42.5)
+ self.assertEqual(self.decimal.Decimal, a.a_type)
+
+ a = A.from_float(42)
+ self.assertEqual(self.decimal.Decimal, a.a_type)
+
class CFormatTest(FormatTest):
decimal = C
class PyFormatTest(FormatTest):