diff options
| author | Larry Hastings <larry@hastings.org> | 2016-06-27 02:53:18 (GMT) |
|---|---|---|
| committer | Larry Hastings <larry@hastings.org> | 2016-06-27 02:53:18 (GMT) |
| commit | 1b329e791ae3a3a2989f05e8c2019b67b4e1a7df (patch) | |
| tree | 91e137c00f35f21a2c17b385f9746492b8347558 /Lib/test/test_decimal.py | |
| parent | 9bb200545970bb920c83124658cb89c7d295166d (diff) | |
| parent | 1e957d145fa1fc05ca1fbb9f135ab162c939ae14 (diff) | |
| download | cpython-1b329e791ae3a3a2989f05e8c2019b67b4e1a7df.zip cpython-1b329e791ae3a3a2989f05e8c2019b67b4e1a7df.tar.gz cpython-1b329e791ae3a3a2989f05e8c2019b67b4e1a7df.tar.bz2 | |
Merge.
Diffstat (limited to 'Lib/test/test_decimal.py')
| -rw-r--r-- | Lib/test/test_decimal.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index c0d21b1..cde5d78 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -2491,7 +2491,8 @@ class PythonAPItests(unittest.TestCase): Decimal = self.decimal.Decimal class MyDecimal(Decimal): - pass + def __init__(self, _): + self.x = 'y' self.assertTrue(issubclass(MyDecimal, Decimal)) @@ -2499,6 +2500,8 @@ class PythonAPItests(unittest.TestCase): self.assertEqual(type(r), MyDecimal) self.assertEqual(str(r), '0.1000000000000000055511151231257827021181583404541015625') + self.assertEqual(r.x, 'y') + bigint = 12345678901234567890123456789 self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint)) self.assertTrue(MyDecimal.from_float(float('nan')).is_qnan()) |
